Package javax.xml.soap

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


                }
                if (xmlReader.nextTag() == XMLStreamConstants.START_ELEMENT) {
                    ReadHeadersInterceptor.readVersion(xmlReader, message);
                }
                MessageFactory factory = getFactory(message);
                SOAPMessage soapMessage = factory.createMessage();
                message.setContent(SOAPMessage.class, soapMessage);
               
                SOAPPart part = soapMessage.getSOAPPart();
                message.setContent(Node.class, part);
                message.put(W3CDOMStreamWriter.class, new SAAJStreamWriter(part));
View Full Code Here


    @Before
    public void setUp() throws Exception {
        this.messageSource = new ResourceBundleMessageSource();
        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

        mappings.setProperty(Exception.class.getName(), "SERVER, Server error");
        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);
View Full Code Here

        mappings.setProperty(Exception.class.getName(), "RECEIVER, Receiver error, en");
        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);
View Full Code Here

        mappings.setProperty(Exception.class.getName(), "CLIENT, Client error");
        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);
View Full Code Here

        mappings.setProperty(Exception.class.getName(), "SENDER, Sender error");
        mappings.setProperty(RuntimeException.class.getName(), "RECEIVER, Receiver error");
        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);
View Full Code Here

        resolver.setExceptionMappings(mappings);
        SoapFaultDefinition defaultFault = new SoapFaultDefinition();
        defaultFault.setFaultCode(SoapFaultDefinition.CLIENT);
        resolver.setDefaultFault(defaultFault);
        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);
View Full Code Here

        Properties mappings = new Properties();
        mappings.setProperty(IOException.class.getName(), "SERVER");
        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 IOException());
        Assert.assertTrue("resolveException returns false", result);
View Full Code Here

     * "text/xml; charset=UTF-8", causing issues with Axiom. We basically reset the command map
     */
    @Before
    public void removeXmlDataContentHandler() throws SOAPException {
        MessageFactory messageFactory = MessageFactory.newInstance();
        SOAPMessage message = messageFactory.createMessage();
        message.createAttachmentPart();
        CommandMap.setDefaultCommandMap(new MailcapCommandMap());
    }

  @Before
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);
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.