Package javax.xml.soap

Examples of javax.xml.soap.MessageFactory.createMessage()


public class SaajSoap11HeaderTest extends AbstractSoap11HeaderTestCase {

    @Override
    protected SoapHeader createSoapHeader() throws Exception {
        MessageFactory messageFactory = MessageFactory.newInstance(SOAPConstants.SOAP_1_1_PROTOCOL);
        SOAPMessage saajMessage = messageFactory.createMessage();
        return new SaajSoap11Header(saajMessage.getSOAPPart().getEnvelope().getHeader());
    }
}
View Full Code Here


                    .getBean("messageSender", CommonsHttpMessageSender.class);
            connection = messageSender.createConnection(new URI("http://localhost:" + port));

            appContext.close();

            connection.send(new SaajSoapMessage(messageFactory.createMessage()));
            connection.receive(new SaajSoapMessageFactory(messageFactory));
        }
        finally {
            if (connection != null) {
                try {
View Full Code Here

public class SaajSoap11EnvelopeTest extends AbstractSoap11EnvelopeTestCase {

    @Override
    protected SoapEnvelope createSoapEnvelope() throws Exception {
        MessageFactory messageFactory = MessageFactory.newInstance(SOAPConstants.SOAP_1_1_PROTOCOL);
        SOAPMessage saajMessage = messageFactory.createMessage();
        return new SaajSoapEnvelope(saajMessage.getSOAPPart().getEnvelope(), true);
    }
}
View Full Code Here

    }

    @Test
    public void testProcessMustUnderstandHeadersUnderstoodSoap11() throws Exception {
        MessageFactory messageFactory = MessageFactory.newInstance(SOAPConstants.SOAP_1_1_PROTOCOL);
        SOAPMessage request = messageFactory.createMessage();
        SOAPHeaderElement header =
                request.getSOAPHeader().addHeaderElement(new QName("http://www.springframework.org", "Header"));
        header.setActor(SOAPConstants.URI_SOAP_ACTOR_NEXT);
        header.setMustUnderstand(true);
        SoapMessageFactory factory = new SaajSoapMessageFactory(messageFactory);
View Full Code Here

    }

    @Test
    public void testProcessMustUnderstandHeadersUnderstoodSoap12() throws Exception {
        MessageFactory messageFactory = MessageFactory.newInstance(SOAPConstants.SOAP_1_2_PROTOCOL);
        SOAPMessage request = messageFactory.createMessage();
        SOAPHeaderElement header =
                request.getSOAPHeader().addHeaderElement(new QName("http://www.springframework.org", "Header"));
        header.setMustUnderstand(true);
        header.setRole(SOAPConstants.URI_SOAP_1_2_ROLE_NEXT);
        SoapMessageFactory factory = new SaajSoapMessageFactory(messageFactory);
View Full Code Here

    }

    @Test
    public void testProcessMustUnderstandHeadersNotUnderstoodSoap11() throws Exception {
        MessageFactory messageFactory = MessageFactory.newInstance(SOAPConstants.SOAP_1_1_PROTOCOL);
        SOAPMessage request = messageFactory.createMessage();
        SOAPHeaderElement header = request.getSOAPHeader()
                .addHeaderElement(new QName("http://www.springframework.org", "Header", "spring-ws"));
        header.setActor(SOAPConstants.URI_SOAP_ACTOR_NEXT);
        header.setMustUnderstand(true);
        SoapMessageFactory factory = new SaajSoapMessageFactory(messageFactory);
View Full Code Here

    }

    @Test
    public void testProcessMustUnderstandHeadersNotUnderstoodSoap12() throws Exception {
        MessageFactory messageFactory = MessageFactory.newInstance(SOAPConstants.SOAP_1_2_PROTOCOL);
        SOAPMessage request = messageFactory.createMessage();
        SOAPHeaderElement header = request.getSOAPHeader()
                .addHeaderElement(new QName("http://www.springframework.org", "Header", "spring-ws"));
        header.setMustUnderstand(true);
        header.setRole(SOAPConstants.URI_SOAP_1_2_ROLE_NEXT);
        SoapMessageFactory factory = new SaajSoapMessageFactory(messageFactory);
View Full Code Here

    }

    @Test
    public void testProcessMustUnderstandHeadersForActorSoap11() throws Exception {
        MessageFactory messageFactory = MessageFactory.newInstance(SOAPConstants.SOAP_1_1_PROTOCOL);
        SOAPMessage request = messageFactory.createMessage();
        SOAPHeaderElement header = request.getSOAPHeader()
                .addHeaderElement(new QName("http://www.springframework.org", "Header", "spring-ws"));
        String headerActor = "http://www/springframework.org/role";
        header.setActor(headerActor);
        header.setMustUnderstand(true);
View Full Code Here

    }

    @Test
    public void testProcessMustUnderstandHeadersForRoleSoap12() throws Exception {
        MessageFactory messageFactory = MessageFactory.newInstance(SOAPConstants.SOAP_1_2_PROTOCOL);
        SOAPMessage request = messageFactory.createMessage();
        SOAPHeaderElement header = request.getSOAPHeader()
                .addHeaderElement(new QName("http://www.springframework.org", "Header", "spring-ws"));
        String headerRole = "http://www/springframework.org/role";
        header.setRole(headerRole);
        header.setMustUnderstand(true);
View Full Code Here

    }

    @Test
    public void testProcessNoHeader() throws Exception {
        MessageFactory messageFactory = MessageFactory.newInstance(SOAPConstants.SOAP_1_1_PROTOCOL);
        SOAPMessage request = messageFactory.createMessage();
        request.getSOAPHeader().detachNode();
        SoapMessageFactory factory = new SaajSoapMessageFactory(messageFactory);
        MessageContext context = new DefaultMessageContext(new SaajSoapMessage(request), factory);
        replay(interceptorMock);
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.