Examples of SOAPFaultException


Examples of org.apache.axis2.SOAPFaultException

     */
    private void extractFaultInformationFromMessageContext(
        MessageContext context,
        SOAPFault fault,
        Throwable e) {
        SOAPFaultException soapException = null;
        String soapNamespaceURI = "";

        // get the current SOAP version
        if (!context.isSOAP11()) {
            // defaulting to SOAP 1.2
            soapNamespaceURI = SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI;
        } else {
            soapNamespaceURI = SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI;
        }

        if (e instanceof SOAPProcessingException) {
            soapException = (SOAPProcessingException) e;
        } else if (e instanceof AxisFault) {
            if (e.getCause() instanceof SOAPProcessingException) {
                soapException = (SOAPProcessingException) e.getCause();
            } else  {
                soapException = (SOAPFaultException) e;
            }
        } else {
            // we have recd an instance of just the Exception class
        }

        Object faultCode =
            context.getProperty(SOAP12Constants.SOAP_FAULT_CODE_LOCAL_NAME);
        String soapFaultCode = "";
        if (faultCode != null) {
            fault.setCode((SOAPFaultCode) faultCode);
        } else if (soapException != null) {
            soapFaultCode = soapException.getFaultCode();

            // defaulting to fault code Sender, if no message is available
            soapFaultCode =
                ("".equals(soapFaultCode) || soapFaultCode == null)
                    ? getSenderFaultCode(soapNamespaceURI)
                    : soapFaultCode;
            fault.getCode().getValue().setText(soapFaultCode);
        }

        Object faultReason =
            context.getProperty(SOAP12Constants.SOAP_FAULT_REASON_LOCAL_NAME);
        String message = "";
        if (faultReason != null) {
            fault.setReason((SOAPFaultReason) faultReason);
        } else if (soapException != null) {
            message = soapException.getMessage();

            // defaulting to reason, unknown, if no reason is available
            message =
                ("".equals(message) || message == null) ? "unknown" : message;
            fault.getReason().getSOAPText().setText(message);
View Full Code Here

Examples of org.jibx.ws.soap.SoapFaultException

     */
    public Welcome welcomeService(Greetee greetee) throws WsException {
        char firstChar = greetee.getName().charAt(0);
        if (firstChar != 'z' && firstChar != 'Z') {
            SoapFault fault = createFaultFor(greetee);
            throw new SoapFaultException(fault);
        }
        return new Welcome("Howdy " + greetee.getName() + "!");
    }
View Full Code Here

Examples of org.jibx.ws.soap.SoapFaultException

    private Object handleFault(SoapFault fault) {
        if (m_soapFaultResolver != null) {
            return m_soapFaultResolver.handleFault(fault);
        }
        throw new SoapFaultException(fault);
    }
View Full Code Here

Examples of org.mule.module.ws.consumer.SoapFaultException

    protected void assertSoapFault(String address, String message, Map<String, Object> properties, String expectedFaultCode) throws Exception
    {
        MuleClient client = muleContext.getClient();
        MuleMessage response = client.send(address, message, properties);
        assertEquals(NullPayload.getInstance(), response.getPayload());
        SoapFaultException exception = (SoapFaultException) response.getExceptionPayload().getException();
        assertEquals(expectedFaultCode, exception.getFaultCode().getLocalPart());
    }
View Full Code Here

Examples of org.opensaml.ws.soap.client.SOAPFaultException

                throw new SOAPClientException("HTTP status code was 500 but SOAP response did not contain a Fault");
            }
            Fault fault = (Fault) faults.get(0);

            log.debug("SOAP fault code {} with message {}", fault.getCode().getValue(), fault.getMessage().getValue());
            SOAPFaultException faultException = new SOAPFaultException("SOAP Fault: " + fault.getCode().getValue()
                    + " Fault Message: " + fault.getMessage().getValue());
            faultException.setFault(fault);
            throw faultException;
        } catch (IOException e) {
            throw new SOAPClientException("Unable to read response", e);
        }
    }
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.