Package org.springframework.ws.soap.saaj

Examples of org.springframework.ws.soap.saaj.SaajSoapMessageFactory


    extends AbstractSoap12WebServiceTemplateIntegrationTestCase {

  @Override
  public SoapMessageFactory createMessageFactory() throws Exception {
    MessageFactory messageFactory = MessageFactory.newInstance(SOAPConstants.SOAP_1_2_PROTOCOL);
    return new SaajSoapMessageFactory(messageFactory);
  }
View Full Code Here


        mimeHeaders.addHeader("Content-Type", " application/soap+xml");
        InputStream is = getClass().getResourceAsStream("valid.xml");
        assertNotNull("Could not load valid.xml", is);
        try {
            SaajSoapMessage message = new SaajSoapMessage(messageFactory.createMessage(mimeHeaders, is));
            return new DefaultMessageContext(message, new SaajSoapMessageFactory(messageFactory));
        }
        finally {
            is.close();
        }
    }
View Full Code Here

    }

    @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

TOP

Related Classes of org.springframework.ws.soap.saaj.SaajSoapMessageFactory

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.