Package javax.xml.soap

Examples of javax.xml.soap.SOAPFactory.createFault()


    /** for soap 1.2 */
    @Validated @Test
    public void testSOAPFaultException2() {
        try {
            SOAPFactory factory = SOAPFactory.newInstance(SOAPConstants.SOAP_1_2_PROTOCOL);
            SOAPFault sf = factory.createFault("This is the fault reason.",
                                               new QName("http://MyNamespaceURI.org/",
                                                         "My Fault Code"));
            fail("Did not throw expected SOAPException");
        } catch (UnsupportedOperationException e) {
            //Caught expected UnsupportedOperationException
View Full Code Here


        try {
            SOAPFactory factory;
            SOAPFault fault;
            if (soapVer == SOAPVersion.SOAP_12) {
                factory = SOAPVersion.SOAP_12.saajSoapFactory;
                fault = factory.createFault();
                fault.setFaultCode(SOAPConstants.SOAP_SENDER_FAULT);
                fault.appendFaultSubcode(subcode);
                fault.appendFaultSubcode(subsubcode);
                getInvalidMapDetail(name, fault.addDetail());
            } else {
View Full Code Here

                fault.appendFaultSubcode(subcode);
                fault.appendFaultSubcode(subsubcode);
                getInvalidMapDetail(name, fault.addDetail());
            } else {
                factory = SOAPVersion.SOAP_11.saajSoapFactory;
                fault = factory.createFault();
                fault.setFaultCode(subsubcode);
            }

            fault.setFaultString(faultstring);
View Full Code Here

        try {
            SOAPFactory factory;
            SOAPFault fault;
            if (soapVer == SOAPVersion.SOAP_12) {
                factory = SOAPVersion.SOAP_12.saajSoapFactory;
                fault = factory.createFault();
                fault.setFaultCode(SOAPConstants.SOAP_SENDER_FAULT);
                fault.appendFaultSubcode(subcode);
                fault.appendFaultSubcode(subsubcode);
                getMapRequiredDetail(e.getMissingHeaderQName(), fault.addDetail());
            } else {
View Full Code Here

                fault.appendFaultSubcode(subcode);
                fault.appendFaultSubcode(subsubcode);
                getMapRequiredDetail(e.getMissingHeaderQName(), fault.addDetail());
            } else {
                factory = SOAPVersion.SOAP_11.saajSoapFactory;
                fault = factory.createFault();
                fault.setFaultCode(subsubcode);
            }

            fault.setFaultString(faultstring);
View Full Code Here

                    return response;
                }
                catch (final AlreadyRegisteredException alreadyRegisteredException)
                {
                    SOAPFactory factory = SOAPFactory.newInstance();
                    SOAPFault soapFault = factory.createFault(SoapFaultType.FAULT_SENDER.getValue(), CoordinationConstants.WSCOOR_ERROR_CODE_CANNOT_REGISTER_QNAME);
                    soapFault.addDetail().addDetailEntry(CoordinationConstants.WSCOOR_ERROR_CODE_CANNOT_REGISTER_QNAME).addTextNode(WSCLogger.log_mesg.getString("com.arjuna.wsc11.messaging.RegistrationCoordinatorProcessorImpl_1"));
                    throw new SOAPFaultException(soapFault);
                }
                catch (final InvalidProtocolException invalidProtocolException)
                {
View Full Code Here

                    throw new SOAPFaultException(soapFault);
                }
                catch (final InvalidProtocolException invalidProtocolException)
                {
                    SOAPFactory factory = SOAPFactory.newInstance();
                    SOAPFault soapFault = factory.createFault(SoapFaultType.FAULT_SENDER.getValue(), CoordinationConstants.WSCOOR_ERROR_CODE_INVALID_PROTOCOL_QNAME);
                    soapFault.addDetail().addDetailEntry(CoordinationConstants.WSCOOR_ERROR_CODE_INVALID_PARAMETERS_QNAME).addTextNode(WSCLogger.log_mesg.getString("com.arjuna.wsc11.messaging.RegistrationCoordinatorProcessorImpl_2"));
                    throw new SOAPFaultException(soapFault);
                }
                catch (final InvalidStateException InvalidStateException)
                {
View Full Code Here

                    throw new SOAPFaultException(soapFault);
                }
                catch (final InvalidStateException InvalidStateException)
                {
                    SOAPFactory factory = SOAPFactory.newInstance();
                    SOAPFault soapFault = factory.createFault(SoapFaultType.FAULT_SENDER.getValue(), CoordinationConstants.WSCOOR_ERROR_CODE_INVALID_STATE_QNAME);
                    soapFault.addDetail().addDetailEntry(CoordinationConstants.WSCOOR_ERROR_CODE_INVALID_STATE_QNAME).addTextNode(WSCLogger.log_mesg.getString("com.arjuna.wsc11.messaging.RegistrationCoordinatorProcessorImpl_3"));
                    throw new SOAPFaultException(soapFault);
                }
                catch (final NoActivityException noActivityException)
                {
View Full Code Here

                    throw new SOAPFaultException(soapFault);
                }
                catch (final NoActivityException noActivityException)
                {
                    SOAPFactory factory = SOAPFactory.newInstance();
                    SOAPFault soapFault = factory.createFault(SoapFaultType.FAULT_SENDER.getValue(), CoordinationConstants.WSCOOR_ERROR_CODE_CANNOT_REGISTER_QNAME);
                    soapFault.addDetail().addDetailEntry(CoordinationConstants.WSCOOR_ERROR_CODE_CANNOT_REGISTER_QNAME).addTextNode(WSCLogger.log_mesg.getString("com.arjuna.wsc11.messaging.RegistrationCoordinatorProcessorImpl_4"));
                    throw new SOAPFaultException(soapFault);
                }
                catch (final Throwable th)
                {
View Full Code Here

                    if (WSCLogger.arjLoggerI18N.isDebugEnabled())
                    {
                        WSCLogger.arjLoggerI18N.debug("com.arjuna.wsc11.messaging.RegistrationCoordinatorProcessorImpl_5", th) ;
                    }
                    SOAPFactory factory = SOAPFactory.newInstance();
                    SOAPFault soapFault = factory.createFault(SoapFaultType.FAULT_SENDER.getValue(), CoordinationConstants.WSCOOR_ERROR_CODE_CANNOT_REGISTER_QNAME);
                    soapFault.addDetail().addDetailEntry(CoordinationConstants.WSCOOR_ERROR_CODE_CANNOT_REGISTER_QNAME).addTextNode(th.getMessage());
                    throw new SOAPFaultException(soapFault);
                }
            }
            else
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.