Package org.springframework.ws.soap

Examples of org.springframework.ws.soap.SoapMessageFactory


    }

    @Test
    public void testResolveExceptionClientSoap11() throws Exception {
        MessageFactory saajFactory = MessageFactory.newInstance(SOAPConstants.SOAP_1_1_PROTOCOL);
        SoapMessageFactory factory = new SaajSoapMessageFactory(saajFactory);
        MessageContext context = new DefaultMessageContext(factory);

        boolean result = resolver.resolveException(context, null, new MyClientException());
        Assert.assertTrue("resolveException returns false", result);
        Assert.assertTrue("Context has no response", context.hasResponse());
View Full Code Here


    }

    @Test
    public void testResolveExceptionSenderSoap12() throws Exception {
        MessageFactory saajFactory = MessageFactory.newInstance(SOAPConstants.SOAP_1_2_PROTOCOL);
        SoapMessageFactory factory = new SaajSoapMessageFactory(saajFactory);
        MessageContext context = new DefaultMessageContext(factory);

        boolean result = resolver.resolveException(context, null, new MySenderException());
        Assert.assertTrue("resolveException returns false", result);
        Assert.assertTrue("Context has no response", context.hasResponse());
View Full Code Here

    }

    @Test
    public void testResolveExceptionServerSoap11() throws Exception {
        MessageFactory saajFactory = MessageFactory.newInstance(SOAPConstants.SOAP_1_1_PROTOCOL);
        SoapMessageFactory factory = new SaajSoapMessageFactory(saajFactory);
        MessageContext context = new DefaultMessageContext(factory);

        boolean result = resolver.resolveException(context, null, new MyServerException());
        Assert.assertTrue("resolveException returns false", result);
        Assert.assertTrue("Context has no response", context.hasResponse());
View Full Code Here

    @Test
    public void testResolveExceptionReceiverSoap12() throws Exception {
        MessageFactory saajFactory = MessageFactory.newInstance(SOAPConstants.SOAP_1_2_PROTOCOL);
        SOAPMessage message = saajFactory.createMessage();
        SoapMessageFactory factory = new SaajSoapMessageFactory(saajFactory);
        MessageContext context = new DefaultMessageContext(new SaajSoapMessage(message), factory);

        boolean result = resolver.resolveException(context, null, new MyReceiverException());
        Assert.assertTrue("resolveException returns false", result);
        Assert.assertTrue("Context has no response", context.hasResponse());
View Full Code Here

        SoapFaultDefinition defaultFault = new SoapFaultDefinition();
        defaultFault.setFaultCode(SoapFaultDefinition.CLIENT);
        defaultFault.setFaultStringOrReason("faultstring");
        resolver.setDefaultFault(defaultFault);
        MessageFactory saajFactory = MessageFactory.newInstance(SOAPConstants.SOAP_1_1_PROTOCOL);
        SoapMessageFactory factory = new SaajSoapMessageFactory(saajFactory);
        MessageContext context = new DefaultMessageContext(factory);

        boolean result = resolver.resolveException(context, null, new NonAnnotatedException());
        Assert.assertTrue("resolveException returns false", result);
        Assert.assertTrue("Context has no response", context.hasResponse());
View Full Code Here

    }

    @Test
    public void testResolveExceptionCustom() throws Exception {
        MessageFactory saajFactory = MessageFactory.newInstance(SOAPConstants.SOAP_1_1_PROTOCOL);
        SoapMessageFactory factory = new SaajSoapMessageFactory(saajFactory);
        MessageContext context = new DefaultMessageContext(factory);

        boolean result = resolver.resolveException(context, null, new MyCustomException());
        Assert.assertTrue("resolveException returns false", result);
        Assert.assertTrue("Context has no response", context.hasResponse());
View Full Code Here

    }

    @Test
    public void testResolveExceptionInheritance() throws Exception {
        MessageFactory saajFactory = MessageFactory.newInstance(SOAPConstants.SOAP_1_1_PROTOCOL);
        SoapMessageFactory factory = new SaajSoapMessageFactory(saajFactory);
        MessageContext context = new DefaultMessageContext(factory);

        boolean result = resolver.resolveException(context, null, new MySubClientException());
        Assert.assertTrue("resolveException returns false", result);
        Assert.assertTrue("Context has no response", context.hasResponse());
View Full Code Here

    }

    @Test
    public void testResolveExceptionExceptionMessage() throws Exception {
        MessageFactory saajFactory = MessageFactory.newInstance(SOAPConstants.SOAP_1_1_PROTOCOL);
        SoapMessageFactory factory = new SaajSoapMessageFactory(saajFactory);
        MessageContext context = new DefaultMessageContext(factory);

        boolean result = resolver.resolveException(context, null, new NoStringOrReasonException("Exception message"));
        Assert.assertTrue("resolveException returns false", result);
        Assert.assertTrue("Context has no response", context.hasResponse());
View Full Code Here

        mappings.setProperty(RuntimeException.class.getName(), "CLIENT, Client error");
        resolver.setExceptionMappings(mappings);

        MessageFactory messageFactory = MessageFactory.newInstance(SOAPConstants.SOAP_1_1_PROTOCOL);
        SOAPMessage message = messageFactory.createMessage();
        SoapMessageFactory factory = new SaajSoapMessageFactory(messageFactory);
        MessageContext context = new DefaultMessageContext(new SaajSoapMessage(message), factory);

        boolean result = resolver.resolveException(context, null, new IllegalArgumentException("bla"));
        Assert.assertTrue("resolveException returns false", result);
        Assert.assertTrue("Context has no response", context.hasResponse());
View Full Code Here

        mappings.setProperty(RuntimeException.class.getName(), "SENDER, Sender error, en");
        resolver.setExceptionMappings(mappings);

        MessageFactory messageFactory = MessageFactory.newInstance(SOAPConstants.SOAP_1_2_PROTOCOL);
        SOAPMessage message = messageFactory.createMessage();
        SoapMessageFactory factory = new SaajSoapMessageFactory(messageFactory);
        MessageContext context = new DefaultMessageContext(new SaajSoapMessage(message), factory);

        boolean result = resolver.resolveException(context, null, new IllegalArgumentException("bla"));
        Assert.assertTrue("resolveException returns false", result);
        Assert.assertTrue("Context has no response", context.hasResponse());
View Full Code Here

TOP

Related Classes of org.springframework.ws.soap.SoapMessageFactory

Copyright © 2018 www.massapicom. 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.