Package org.springframework.xml.transform

Examples of org.springframework.xml.transform.ResourceSource


        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));
        StringResult expected = new StringResult();
        transformer.transform(new SAXSource(SaxUtils.createInputSource(output)), expected);
View Full Code Here


    public void testPox() throws Exception {
        interceptor.setRequestXslt(xslt);
        interceptor.afterPropertiesSet();
        DomPoxMessageFactory factory = new DomPoxMessageFactory();
        DomPoxMessage message = factory.createWebServiceMessage();
        transformer.transform(new ResourceSource(input), message.getPayloadResult());
        MessageContext context = new DefaultMessageContext(message, factory);

        Assert.assertTrue("Invalid interceptor result", interceptor.handleRequest(context, null));
        StringResult expected = new StringResult();
        transformer.transform(new SAXSource(SaxUtils.createInputSource(output)), expected);
View Full Code Here

        if (requestXslt != null) {
            Assert.isTrue(requestXslt.exists(), "requestXslt \"" + requestXslt + "\" does not exit");
            if (logger.isInfoEnabled()) {
                logger.info("Transforming request using " + requestXslt);
            }
            Source requestSource = new ResourceSource(xmlReader, requestXslt);
            requestTemplates = transformerFactory.newTemplates(requestSource);
        }
        if (responseXslt != null) {
            Assert.isTrue(responseXslt.exists(), "responseXslt \"" + responseXslt + "\" does not exit");
            if (logger.isInfoEnabled()) {
                logger.info("Transforming response using " + responseXslt);
            }
            Source responseSource = new ResourceSource(xmlReader, responseXslt);
            responseTemplates = transformerFactory.newTemplates(responseSource);
        }
    }
View Full Code Here

        XMLReader xmlReader = XMLReaderFactory.createXMLReader();
        xmlReader.setFeature("http://xml.org/sax/features/namespace-prefixes", true);
        for (int i = 0; i < resources.length; i++) {
            Assert.notNull(resources[i], "Resource is null");
            Assert.isTrue(resources[i].exists(), "Resource " + resources[i] + " does not exist");
            schemaSources[i] = new ResourceSource(xmlReader, resources[i]);
        }
        SchemaFactory schemaFactory = SchemaFactory.newInstance(schemaLanguage);
        return schemaFactory.newSchema(schemaSources);
    }
View Full Code Here

     * @param payload the XML payload
     * @return the request matcher
     */
    public static RequestMatcher payload(Resource payload) throws IOException {
        Assert.notNull(payload, "'payload' must not be null");
        return payload(new ResourceSource(payload));
    }
View Full Code Here

     * @return the request matcher
     * @since 2.1.1
     */
    public static RequestMatcher soapEnvelope(Resource soapEnvelope) throws IOException {
        Assert.notNull(soapEnvelope, "'soapEnvelope' must not be null");
        return soapEnvelope(new ResourceSource(soapEnvelope));
    }
View Full Code Here

     * @param payload the response payload
     * @return the response callback
     */
    public static ResponseCreator withPayload(Resource payload) throws IOException {
        Assert.notNull(payload, "'payload' must not be null");
        return withPayload(new ResourceSource(payload));
    }
View Full Code Here

     * @return the response callback
     * @since 2.1.1
     */
    public static ResponseCreator withSoapEnvelope(Resource soapEnvelope) throws IOException {
        Assert.notNull(soapEnvelope, "'soapEnvelope' must not be null");
        return withSoapEnvelope(new ResourceSource(soapEnvelope));
    }
View Full Code Here

     *
     * @param payload the XML payload
     * @return the response matcher
     */
    public static ResponseMatcher payload(Resource payload) throws IOException {
        return payload(new ResourceSource(payload));
    }
View Full Code Here

     * @param soapEnvelope the XML SOAP envelope
     * @return the response matcher
     * @since 2.1.1
     */
    public static ResponseMatcher soapEnvelope(Resource soapEnvelope) throws IOException {
        return soapEnvelope(new ResourceSource(soapEnvelope));
    }
View Full Code Here

TOP

Related Classes of org.springframework.xml.transform.ResourceSource

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.