Examples of addFault()


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()

            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()

            }
            soapMessage = SAAJFactoryResolver.createMessageFactory(version).createMessage();
            msg.setContent(SOAPMessage.class, soapMessage);

            SOAPBody body = soapMessage.getSOAPBody();
            SOAPFault soapFault = body.addFault();

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

Examples of org.apache.axiom.soap.SOAPBody.addFault()

    protected void runTest() throws Throwable {
        SOAPEnvelope envelope = soapFactory.createSOAPEnvelope();
        assertFalse(envelope.hasFault());
        SOAPBody body = soapFactory.createSOAPBody(envelope);
        assertFalse(envelope.hasFault());
        body.addFault(new Exception("This an exception for testing"));
        assertTrue(envelope.hasFault());
    }
}
View Full Code Here

Examples of org.apache.axiom.soap.SOAPBody.addFault()

    }

    protected void runTest() throws Throwable {
        SOAPEnvelope envelope = soapFactory.createSOAPEnvelope();
        SOAPBody body = soapFactory.createSOAPBody(envelope);
        body.addFault(soapFactory.createSOAPFault());
        assertTrue(
                "Body Test:- After calling addFault method, SOAP body has no fault",
                body.hasFault());
    }
}
View Full Code Here

Examples of org.apache.axiom.soap.SOAPBody.addFault()

        SOAPEnvelope envelope = soapFactory.createSOAPEnvelope();
        SOAPBody body = soapFactory.createSOAPBody(envelope);
        assertFalse(
                "Body Test:- After creating a soap body it has a fault",
                body.hasFault());
        body.addFault(new Exception("This an exception for testing"));
        assertTrue(
                "Body Test:- After calling addFault method, hasFault method returns false",
                body.hasFault());
    }
}
View Full Code Here

Examples of org.apache.axiom.soap.SOAPBody.addFault()

        SOAPEnvelope envelope = soapFactory.createSOAPEnvelope();
        SOAPBody body = soapFactory.createSOAPBody(envelope);
        assertNull(
                "Body Test:- After creating a soap body it has a fault",
                body.getFault());
        body.addFault(new Exception("This an exception for testing"));
        assertNotNull(
                "Body Test:- After calling addFault method, getFault method returns null",
                body.getFault());
    }
}
View Full Code Here

Examples of org.apache.axiom.soap.SOAPBody.addFault()

    }

    protected void runTest() throws Throwable {
        SOAPEnvelope envelope = soapFactory.createSOAPEnvelope();
        SOAPBody body = soapFactory.createSOAPBody(envelope);
        body.addFault(new Exception("This an exception for testing"));
        assertTrue(
                "Body Test:- After calling addFault method, SOAP body has no fault",
                body.hasFault());
    }
}
View Full Code Here

Examples of org.apache.axis.description.OperationDesc.addFault()

        }

        // Build faults
        for (final JaxRpcFaultInfo faultInfo : operationInfo.faults) {
            final FaultDesc faultDesc = buildFaultDesc(faultInfo);
            operationDesc.addFault(faultDesc);
        }

        return operationDesc;
    }
View Full Code Here

Examples of org.apache.cxf.service.model.OperationInfo.addFault()

            copyExtensionAttributes(minfo, output);
        }
        Map<?, ?> m = op.getFaults();
        for (Map.Entry<?, ?> rawentry : m.entrySet()) {
            Map.Entry<String, Fault> entry = cast(rawentry, String.class, Fault.class);
            FaultInfo finfo = opInfo.addFault(new QName(inf.getName().getNamespaceURI(), entry.getKey()),
                                              entry.getValue().getMessage().getQName());
            copyDocumentation(finfo, entry.getValue());
            buildMessage(finfo, entry.getValue().getMessage());
            copyExtensors(finfo, entry.getValue().getExtensibilityElements());
            copyExtensionAttributes(finfo, entry.getValue());
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.