Examples of SoapFault


Examples of javax.xml.soap.SOAPFault

       
        SOAPPart part = (SOAPPart)nd;
        assertEquals("S", part.getEnvelope().getPrefix());
        assertEquals("S2", part.getEnvelope().getHeader().getPrefix());
        assertEquals("S3", part.getEnvelope().getBody().getPrefix());
        SOAPFault fault = part.getEnvelope().getBody().getFault();
        assertEquals("S", fault.getPrefix());
       
        assertEquals("Authentication Failure", fault.getFaultString());
       
        SoapFault fault2 = (SoapFault)m.getContent(Exception.class);
        assertNotNull(fault2);
       
        assertEquals(Soap12.getInstance().getSender(), fault2.getFaultCode());
View Full Code Here

Examples of javax.xml.soap.SOAPFault

                        part.getEnvelope().addHeader();
                    }
                    setChild(adjustPrefix(part.getEnvelope().getHeader(), prefix), false);
                    return;
                } else if ("Fault".equals(local)) {
                    SOAPFault f = part.getEnvelope().getBody().getFault();
                    if (f == null) {
                        Element el = part.createElementNS(namespace,
                                             StringUtils.isEmpty(prefix) ? local : prefix + ":" + local);
                        part.getEnvelope().getBody().appendChild(el);
                        f = part.getEnvelope().getBody().getFault();
                        if (f == null) {
                            f = part.getEnvelope().getBody().addFault();
                        }
                    }
                    setChild(adjustPrefix(f, prefix), false);
                    return;
                }
            } else if (getCurrentNode() instanceof SOAPFault) {
                SOAPFault f = (SOAPFault)getCurrentNode();
                Node nd = f.getFirstChild();
                while (nd != null) {
                    if (nd instanceof Element) {
                        Element el = (Element)nd;
                        if (local.equals(nd.getLocalName())) {
                            setChild(el, false);
View Full Code Here

Examples of nexj.core.rpc.soap.SOAPFault

               if (!bEnvelopeOpen)
               {
                  writer.write(SOAP_WRAP_PREFIX);
               }

               marshaller.serialize(new SOAPFault(t), writer);

               writer.write(SOAP_WRAP_SUFFIX);
            }
         }
         catch (RPCException e)
View Full Code Here

Examples of org.apache.axiom.soap.SOAPFault

        }
       
        // Check whether the message to be written is a fault message
        if (msgCtx.getFLOW() == MessageContext.OUT_FAULT_FLOW || msgCtx.getEnvelope().hasFault()) {
           
            SOAPFault soapFault = msgCtx.getEnvelope().getBody().getFault();
            convertAndWriteHessianFault(soapFault, out);
        } else {
           
            // no differentiation between normal reply and fault (pass the original message through)
            writeHessianMessage(msgCtx, out);
View Full Code Here

Examples of org.apache.axiom.soap.SOAPFault

    public void addSoapFaultToMessageContext(MessageContext msgContext, String faultCode,
            String faultReason, String faultDetail) throws AxisFault {
       
        SOAPFactory factory = OMAbstractFactory.getSOAP11Factory();
        SOAPEnvelope faultEnvelope = factory.getDefaultFaultEnvelope();      
        SOAPFault soapFault = faultEnvelope.getBody().getFault();

        SOAPFaultCode soapFaultCode = factory.createSOAPFaultCode();
        soapFaultCode.setText(faultCode);
        soapFault.setCode(soapFaultCode);
       
        SOAPFaultReason soapFaultReason = factory.createSOAPFaultReason();
        soapFaultReason.setText(faultReason);
        soapFault.setReason(soapFaultReason);
       
        SOAPFaultDetail soapFaultDetail = factory.createSOAPFaultDetail();
        soapFaultDetail.setText(faultDetail);
        soapFault.setDetail(soapFaultDetail);
       
        msgContext.setEnvelope(faultEnvelope);
    }
View Full Code Here

Examples of org.apache.axiom.soap.SOAPFault

    private static final Log log = LogFactory.getLog(POXUtils.class);

    public static void convertSOAPFaultToPOX(MessageContext msgCtx) {

        SOAPBody body = msgCtx.getEnvelope().getBody();
        SOAPFault fault = body.getFault();
        if (fault != null) {

            OMFactory fac = msgCtx.getEnvelope().getOMFactory();
            OMElement faultPayload = fac.createOMElement(new QName("Exception"));

            if (fault.getDetail() != null && !fault.getDetail().getText().equals("")) {

                String faultDetail = fault.getDetail().getText();

                if (log.isDebugEnabled()) {
                    log.debug("Setting the fault detail : " + faultDetail + " as athe POX Fault");
                }
                faultPayload.setText(faultDetail);

            } else if (fault.getReason() != null && !fault.getReason().getText().equals("")) {

                String faultReasonValue = fault.getReason().getText();

                if (log.isDebugEnabled()) {
                    log.debug("Setting the fault reason : "
                        + faultReasonValue + " as athe POX Fault");
                }
View Full Code Here

Examples of org.apache.axiom.soap.SOAPFault

        MessageContext synCtx = TestUtils.getAxis2MessageContext(
                "<empty/>", new HashMap<String, Entry>());
        faultMediator.mediate(synCtx);

        SOAPEnvelope envelope = synCtx.getEnvelope();
        SOAPFault fault = envelope.getBody().getFault();
        assertTrue(F_CODE.equals(fault.getCode().getTextAsQName()));
        assertTrue(F_STRING.equals(fault.getReason().getText()));
        assertTrue(F_ACTOR_URI.equals(fault.getRole().getRoleValue()));
        assertTrue(F_DETAIL.equals(fault.getDetail().getText()));
        assertEquals(SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI, envelope.getNamespace().getNamespaceURI());
    }
View Full Code Here

Examples of org.apache.axiom.soap.SOAPFault

        return env;
    }

    public SOAPEnvelope getDefaultFaultEnvelope() throws SOAPProcessingException {
        SOAPEnvelope defaultEnvelope = getDefaultEnvelope();
        SOAPFault fault = createSOAPFault(defaultEnvelope.getBody());

        SOAPFaultCode faultCode = createSOAPFaultCode(fault);
        createSOAPFaultValue(faultCode);

        SOAPFaultReason reason = createSOAPFaultReason(fault);
View Full Code Here

Examples of org.apache.axiom.soap.SOAPFault

        return env;
    }

    public SOAPEnvelope getDefaultFaultEnvelope() throws SOAPProcessingException {
        SOAPEnvelope defaultEnvelope = getDefaultEnvelope();
        SOAPFault fault = createSOAPFault(defaultEnvelope.getBody());

        SOAPFaultCode faultCode = createSOAPFaultCode(fault);

        SOAPFaultReason reason = createSOAPFaultReason(fault);
        //createSOAPFaultText(reason);
View Full Code Here

Examples of org.apache.axiom.soap.SOAPFault

        super(metaFactory, spec);
    }

    protected void runTest() throws Throwable {
        SOAPEnvelope env = soapFactory.getDefaultEnvelope();
        SOAPFault fault = soapFactory.createSOAPFault(env.getBody());
        SOAPFaultCode code = soapFactory.createSOAPFaultCode(fault);
        QName value = new QName("urn:test", "myFaultCode");
        code.setValue(value);
        assertEquals(value, code.getValueAsQName());
    }
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.