Package org.springframework.ws.soap.saaj

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


        this.messageSource.setBasename("org.springframework.ws.soap.server.endpoint.messages");
        MessageFactory messageFactory = MessageFactory.newInstance();
        SOAPMessage request = messageFactory.createMessage();
        request.getSOAPBody().addBodyElement(new QName("http://www.springframework.org/spring-ws", "request"));
        messageContext =
                new DefaultMessageContext(new SaajSoapMessage(request), new SaajSoapMessageFactory(messageFactory));
    }
View Full Code Here


    private MessageContext context;

    @Before
    public void setUp() throws Exception {
        mapping = new SoapActionEndpointMapping();
        context = new DefaultMessageContext(new SaajSoapMessageFactory(MessageFactory.newInstance()));
    }
View Full Code Here

    }

    @Test
    public void testMatch() throws Exception {
        SaajSoapMessage message = loadSaajMessage("200408/valid.xml");
        MessageContext messageContext = new DefaultMessageContext(message, new SaajSoapMessageFactory(messageFactory));

        EndpointInvocationChain endpoint = mapping.getEndpoint(messageContext);
        assertNotNull("No endpoint returned", endpoint);
        assertEquals("Invalid endpoint returned", endpoint1, endpoint.getEndpoint());
        EndpointInterceptor[] interceptors = endpoint.getInterceptors();
View Full Code Here

    }

    @Test
    public void testNoMatch() throws Exception {
        SaajSoapMessage message = loadSaajMessage("200408/response-no-message-id.xml");
        MessageContext messageContext = new DefaultMessageContext(message, new SaajSoapMessageFactory(messageFactory));

        EndpointInvocationChain endpoint = mapping.getEndpoint(messageContext);
        assertNull("Endpoint returned", endpoint);
    }
View Full Code Here

        return "10";
    }

    public void testNoTo() throws Exception {
        SaajSoapMessage valid = loadSaajMessage(getTestPath() + "/request-no-to.xml");
        MessageContext context = new DefaultMessageContext(valid, new SaajSoapMessageFactory(messageFactory));
        URI messageId = new URI("uid:1234");
        expect(strategyMock.newMessageId((SoapMessage) context.getResponse())).andReturn(messageId);
        replay(strategyMock);
        boolean result = interceptor.handleResponse(context, null);
        assertTrue("Request with no To not handled", result);
View Full Code Here

        interceptor.setSchema(new ClassPathResource(SCHEMA, getClass()));
        interceptor.setValidateRequest(true);
        interceptor.setValidateResponse(true);
        interceptor.afterPropertiesSet();

        soap11Factory = new SaajSoapMessageFactory(MessageFactory.newInstance(SOAPConstants.SOAP_1_1_PROTOCOL));

        transformer = TransformerFactory.newInstance().newTransformer();
    }
View Full Code Here

            interceptor.afterPropertiesSet();
            MessageFactory messageFactory = MessageFactory.newInstance();
            SOAPMessage saajMessage =
                    SaajUtils.loadMessage(new ClassPathResource(VALID_SOAP_MESSAGE, getClass()), messageFactory);
            context = new DefaultMessageContext(new SaajSoapMessage(saajMessage),
                    new SaajSoapMessageFactory(messageFactory));

            boolean result = interceptor.handleRequest(context);
            Assert.assertTrue("Invalid response from interceptor", result);
            Assert.assertFalse("Response set", 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

        mappings.setProperty(RuntimeException.class.getName(), "SERVER, Server 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

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.