Examples of AxiomSoapMessageFactory


Examples of org.springframework.ws.soap.axiom.AxiomSoapMessageFactory

    public void testAxiomNoResponseNoPayloadCaching() throws Exception {
        Transformer transformer = TransformerFactory.newInstance().newTransformer();
        SOAPFactory axiomFactory = OMAbstractFactory.getSOAP11Factory();
        AxiomSoapMessage request = new AxiomSoapMessage(axiomFactory);
        transformer.transform(new StringSource(REQUEST), request.getPayloadResult());
        AxiomSoapMessageFactory soapMessageFactory = new AxiomSoapMessageFactory();
        soapMessageFactory.setPayloadCaching(false);
        soapMessageFactory.afterPropertiesSet();
        MessageContext context = new DefaultMessageContext(request, soapMessageFactory);

        MessageEndpoint endpoint = createNoResponseEndpoint();
        endpoint.invoke(context);
        assertFalse("context has response", context.hasResponse());
View Full Code Here

Examples of org.springframework.ws.soap.axiom.AxiomSoapMessageFactory

    protected MessageContext createCachingAxiomMessageContext() throws Exception {
        SOAPFactory axiomFactory = OMAbstractFactory.getSOAP11Factory();
        AxiomSoapMessage request = new AxiomSoapMessage(axiomFactory, true, false);
        transform(new StringSource(XML), request.getPayloadResult());
        AxiomSoapMessageFactory soapMessageFactory = new AxiomSoapMessageFactory();
        soapMessageFactory.afterPropertiesSet();
        return new DefaultMessageContext(request, soapMessageFactory);
    }
View Full Code Here

Examples of org.springframework.ws.soap.axiom.AxiomSoapMessageFactory

    protected MessageContext createNonCachingAxiomMessageContext() throws Exception {
        SOAPFactory axiomFactory = OMAbstractFactory.getSOAP11Factory();
        AxiomSoapMessage request = new AxiomSoapMessage(axiomFactory, false, false);
        transform(new StringSource(XML), request.getPayloadResult());
        AxiomSoapMessageFactory soapMessageFactory = new AxiomSoapMessageFactory();
        soapMessageFactory.setPayloadCaching(false);
        soapMessageFactory.afterPropertiesSet();
        return new DefaultMessageContext(request, soapMessageFactory);
    }
View Full Code Here

Examples of org.springframework.ws.soap.axiom.AxiomSoapMessageFactory

        LocatorImpl locator = new LocatorImpl();
        locator.setLineNumber(0);
        locator.setColumnNumber(0);
        SAXParseException[] exceptions = new SAXParseException[]{new SAXParseException("Message 1", locator),
                new SAXParseException("Message 2", locator),};
        MessageContext messageContext = new DefaultMessageContext(new AxiomSoapMessageFactory());
        interceptor.handleRequestValidationErrors(messageContext, exceptions);
        ByteArrayOutputStream os = new ByteArrayOutputStream();
        messageContext.getResponse().writeTo(os);
        assertXMLEqual(
                "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\">" + "<soapenv:Body>" +
View Full Code Here

Examples of org.springframework.ws.soap.axiom.AxiomSoapMessageFactory

        Assert.assertFalse("Response set", context.hasResponse());
    }

    @Test
    public void testAxiom() throws Exception {
        AxiomSoapMessageFactory messageFactory = new AxiomSoapMessageFactory();
        messageFactory.setPayloadCaching(true);
        messageFactory.afterPropertiesSet();

        PayloadValidatingInterceptor interceptor = new PayloadValidatingInterceptor();
        interceptor.setSchema(new ClassPathResource("codexws.xsd", getClass()));
        interceptor.afterPropertiesSet();

        Resource resource = new ClassPathResource("axiom.xml", getClass());
        TransportInputStream tis = new MockTransportInputStream(resource.getInputStream());
        WebServiceMessage message = messageFactory.createWebServiceMessage(tis);
        MessageContext context = new DefaultMessageContext(message, messageFactory);
        boolean result = interceptor.handleRequest(context, null);
        Assert.assertTrue("Invalid response from interceptor", result);

    }
View Full Code Here

Examples of org.springframework.ws.soap.axiom.AxiomSoapMessageFactory

    }

    @Test
    public void testMultipleNamespacesAxiom() throws Exception {
        AxiomSoapMessageFactory messageFactory = new AxiomSoapMessageFactory();
        messageFactory.setPayloadCaching(true);
        messageFactory.afterPropertiesSet();

        PayloadValidatingInterceptor interceptor = new PayloadValidatingInterceptor();
        interceptor.setSchema(new ClassPathResource("multipleNamespaces.xsd", getClass()));
        interceptor.afterPropertiesSet();

        Resource resource = new ClassPathResource("multipleNamespaces.xml", getClass());
        TransportInputStream tis = new MockTransportInputStream(resource.getInputStream());
        WebServiceMessage message = messageFactory.createWebServiceMessage(tis);
        MessageContext context = new DefaultMessageContext(message, messageFactory);
        boolean result = interceptor.handleRequest(context, null);
        Assert.assertTrue("Invalid response from interceptor", result);

    }
View Full Code Here

Examples of org.springframework.ws.soap.axiom.AxiomSoapMessageFactory

        throw new IllegalArgumentException();
    }

    protected SoapMessageFactory getSoap11MessageFactory() throws Exception {
        if (axiomTest) {
            return new AxiomSoapMessageFactory();
        }
        if (saajTest) {
            return new SaajSoapMessageFactory(saajSoap11MessageFactory);
        }
        throw new IllegalArgumentException();
View Full Code Here

Examples of org.springframework.ws.soap.axiom.AxiomSoapMessageFactory

    }

    protected SoapMessageFactory getSoap12MessageFactory() throws Exception {
        SoapMessageFactory messageFactory;
        if (axiomTest) {
            messageFactory = new AxiomSoapMessageFactory();
        } else if (saajTest) {
            messageFactory = new SaajSoapMessageFactory(saajSoap12MessageFactory);
        } else
            throw new IllegalArgumentException();
        messageFactory.setSoapVersion(SoapVersion.SOAP_12);
View Full Code Here

Examples of org.springframework.ws.soap.axiom.AxiomSoapMessageFactory

        PerformanceTest performanceTest = new PerformanceTest(ssmf, stopWatch);
        performanceTest.test(false);
    }

    private static void axiom(StopWatch stopWatch, boolean caching, boolean streaming) throws Exception {
        AxiomSoapMessageFactory axmf = new AxiomSoapMessageFactory();
        axmf.setPayloadCaching(caching);
        PerformanceTest performanceTest = new PerformanceTest(axmf, stopWatch);
        performanceTest.test(streaming);
    }
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.