Examples of MessageFactory


Examples of javax.xml.soap.MessageFactory

        Assert.assertNull("Detail on fault", fault.getFaultDetail());
    }

    @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);
View Full Code Here

Examples of javax.xml.soap.MessageFactory

        Assert.assertEquals("Invalid fault locale on fault", new Locale("nl"), fault.getFaultStringLocale());
    }

    @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);
View Full Code Here

Examples of javax.xml.soap.MessageFactory

        Assert.assertNull("Detail on fault", fault.getFaultDetail());
    }

    @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);
View Full Code Here

Examples of javax.xml.soap.MessageFactory

    }

    @Test
    public void invoke() throws Exception {

        MessageFactory messageFactory = MessageFactory.newInstance();
        SOAPMessage request = messageFactory.createMessage();
        request.getSOAPBody().addBodyElement(QName.valueOf("{http://springframework.org/spring-ws}Request"));
        MessageContext messageContext =
                new DefaultMessageContext(new SaajSoapMessage(request), new SaajSoapMessageFactory(messageFactory));
        DefaultMethodEndpointAdapter adapter = new DefaultMethodEndpointAdapter();
        adapter.afterPropertiesSet();
View Full Code Here

Examples of javax.xml.soap.MessageFactory

    @Test
    public void testSaaj() throws Exception {
        interceptor.setRequestXslt(xslt);
        interceptor.afterPropertiesSet();
        MessageFactory messageFactory = MessageFactory.newInstance();
        SOAPMessage saajMessage = messageFactory.createMessage();
        SaajSoapMessage message = new SaajSoapMessage(saajMessage);
        transformer.transform(new ResourceSource(input), message.getPayloadResult());
        MessageContext context = new DefaultMessageContext(message, new SaajSoapMessageFactory(messageFactory));

        Assert.assertTrue("Invalid interceptor result", interceptor.handleRequest(context, null));
View Full Code Here

Examples of javax.xml.soap.MessageFactory

    }

    @Test
    public void testSaajResponse() throws Exception {
        Transformer transformer = TransformerFactory.newInstance().newTransformer();
        MessageFactory messageFactory = MessageFactory.newInstance();
        SaajSoapMessage request = new SaajSoapMessage(messageFactory.createMessage());
        transformer.transform(new StringSource(REQUEST), request.getPayloadResult());
        SaajSoapMessageFactory soapMessageFactory = new SaajSoapMessageFactory();
        soapMessageFactory.afterPropertiesSet();
        MessageContext context = new DefaultMessageContext(request, soapMessageFactory);
View Full Code Here

Examples of javax.xml.soap.MessageFactory

    private Transformer transformer;

    @Before
    public void setUp() throws Exception {
        MessageFactory messageFactory = MessageFactory.newInstance();
        message = messageFactory.createMessage();
        SOAPEnvelope envelope = message.getSOAPPart().getEnvelope();
        saajReader = new SaajXmlReader(envelope);
        transformer = TransformerFactory.newInstance().newTransformer();
    }
View Full Code Here

Examples of javax.xml.soap.MessageFactory

    private SOAPEnvelope envelope;

    @Before
    public void setUp() throws Exception {
        MessageFactory messageFactory = MessageFactory.newInstance();
        SOAPMessage message = messageFactory.createMessage();
        envelope = message.getSOAPPart().getEnvelope();
        handler = new SaajContentHandler(envelope.getBody());
        transformer = TransformerFactory.newInstance().newTransformer();
    }
View Full Code Here

Examples of javax.xml.soap.MessageFactory

        return soapConnection;
    }

    private SOAPMessage getSoapMessage() throws SOAPException
    {
        final MessageFactory messageFactory =
            javax.xml.soap.MessageFactory.newInstance();
        final SOAPMessage soapMessage = messageFactory.createMessage();

        // Object for message parts
        final SOAPPart soapPart = soapMessage.getSOAPPart();
        final SOAPEnvelope envelope = soapPart.getEnvelope();
View Full Code Here

Examples of javax.xml.soap.MessageFactory

        return factory12;
    }
   
    public void handleMessage(SoapMessage message) throws Fault {
        try {
            MessageFactory factory = getFactory(message);
            SOAPMessage soapMessage = factory.createMessage();
            message.setContent(SOAPMessage.class, soapMessage);
           
            SOAPPart part = soapMessage.getSOAPPart();
           
            Document node = (Document) message.getContent(Node.class);
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.