Examples of addFault()


Examples of javax.xml.soap.SOAPBody.addFault()

            }

            try
            {
                SOAPBody soapResBody = soapRes.getSOAPBody();
                SOAPFault soapFault = soapResBody.addFault();
                if(faultCode == null)
                   faultCode = "Unavailable";
               
                if (faultCode.contains(":") == false)
                {
View Full Code Here

Examples of javax.xml.soap.SOAPBody.addFault()

      SOAPMessage soapResponse = messageFactory.createMessage();
      soapBody = soapResponse.getSOAPBody();
     
      if (authResponse == null)
      {
        SOAPFault fault = soapBody.addFault();
        fault.setFaultString("Missing authetication data");
        return soapResponse;
       
      } else if (!authResponse.isReturn())
      {
View Full Code Here

Examples of javax.xml.soap.SOAPBody.addFault()

        fault.setFaultString("Missing authetication data");
        return soapResponse;
       
      } else if (!authResponse.isReturn())
      {
        SOAPFault fault = soapBody.addFault();
        fault.setFaultString("Failed authentication");
        return soapResponse;
      }
       
      if (responsePojo != null) {
View Full Code Here

Examples of javax.xml.soap.SOAPBody.addFault()

      }
       
      if (responsePojo != null) {
        JAXB.marshal(responsePojo, new SAAJResult(soapBody));
      } else {
        SOAPFault fault = soapBody.addFault();
        fault.setFaultString("Unrecognized SOAP request.");
      }
      return soapResponse;
    }
View Full Code Here

Examples of javax.xml.soap.SOAPBody.addFault()

            SOAPEnvelope env =
            soapFault.getSOAPPart().getEnvelope();

            SOAPBody body = env.getBody();
            SOAPFault faultElement = body.addFault();

            String soapNs = env.getElementName().getPrefix();
            String fcode = soapNs + ":" + faultCode;

            faultElement.setFaultCode( fcode );
View Full Code Here

Examples of javax.xml.soap.SOAPBody.addFault()

    }

    public void testFaults() throws Exception {
        SOAPEnvelope envelope = getSOAPEnvelope();
        SOAPBody body = envelope.getBody();
        SOAPFault sf = body.addFault();
        sf.setFaultCode("myFault");
        String fc = sf.getFaultCode();
        assertTrue(fc.equals("myFault"));
    }
View Full Code Here

Examples of javax.xml.soap.SOAPBody.addFault()

    }

    public SOAPMessage generateResponse(Operation op, EclipseLinkException ele) throws SOAPException {
        SOAPMessage message = messageFactory.createMessage();
        SOAPBody body = message.getSOAPPart().getEnvelope().getBody();
        body.addFault(new QName(URI_NS_SOAP_1_1_ENVELOPE, "Server"),
            op.getName() + " failed: " + ele.getMessage());
        return message;
    }

    public SOAPMessage generateResponse(Operation op, Object result) throws SOAPException {
View Full Code Here

Examples of javax.xml.soap.SOAPBody.addFault()

            try {
                SOAPMessage originalMsg = message.getContent(SOAPMessage.class);
                SOAPBody body = originalMsg.getSOAPBody();
                body.removeContents();

                SOAPFault soapFault = body.addFault();

                if (exception instanceof SOAPFaultException) {
                    SOAPFaultException sf = (SOAPFaultException)exception;
                    soapFault.setFaultString(sf.getFault().getFaultString());
                    soapFault.setFaultCode(sf.getFault().getFaultCodeAsQName());
View Full Code Here

Examples of javax.xml.soap.SOAPBody.addFault()

      // the SOAPFault so lets piece it together and
      // send it on it's way.
     
      try {
        SOAPBody soapResBody = soapRes.getSOAPBody();    
        SOAPFault soapFault = soapResBody.addFault();
        soapFault.setFaultCode(faultCode);
        soapFault.setFaultString(faultString);
        soapFault.setFaultActor(faultActor);
       
        // We're always going to include a DispositionReport (for
View Full Code Here

Examples of javax.xml.soap.SOAPBody.addFault()

                MessageFactory.newInstance();
        SOAPMessage msg = msgFactory.createMessage();
        SOAPEnvelope envelope =
                msg.getSOAPPart().getEnvelope();
        SOAPBody body = envelope.getBody();
        SOAPFault fault = body.addFault();

        fault.setFaultCode("Client");
        fault.setFaultString(
                "Message does not have necessary info");
        fault.setFaultActor("http://gizmos.com/order");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.