Package org.springframework.xml.transform

Examples of org.springframework.xml.transform.ResourceSource


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


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

        Resource[] schemaResources = new Resource[]{
                new ClassPathResource("multipleSchemas1.xsd", AbstractValidatorFactoryTestCase.class),
                new ClassPathResource("multipleSchemas2.xsd", AbstractValidatorFactoryTestCase.class)};
        validator = createValidator(schemaResources, XmlValidatorFactory.SCHEMA_W3C_XML);

        Source document = new ResourceSource(
                new ClassPathResource("multipleSchemas1.xml", AbstractValidatorFactoryTestCase.class));
        SAXParseException[] errors = validator.validate(document);
        Assert.assertEquals("ValidationErrors returned", 0, errors.length);
        validator = createValidator(schemaResources, XmlValidatorFactory.SCHEMA_W3C_XML);
        document = new ResourceSource(
                new ClassPathResource("multipleSchemas2.xml", AbstractValidatorFactoryTestCase.class));
        errors = validator.validate(document);
        Assert.assertEquals("ValidationErrors returned", 0, errors.length);
    }
View Full Code Here

    @Override
    public Source getSource() {
        try {
            XMLReader xmlReader = XMLReaderFactory.createXMLReader();
            xmlReader.setFeature("http://xml.org/sax/features/namespace-prefixes", true);
            return new ResourceSource(xmlReader, wsdlResource);
        }
        catch (SAXException ex) {
            throw new WsdlDefinitionException("Could not create XMLReader", ex);
        }
        catch (IOException ex) {
View Full Code Here

    @Override
    protected URI lookupDestination() {
        try {
            DOMResult result = new DOMResult();
            Transformer transformer = transformerFactory.newTransformer();
            transformer.transform(new ResourceSource(wsdlResource), result);
            Document definitionDocument = (Document) result.getNode();
            String location = locationXPathExpression.evaluateAsString(definitionDocument);
            if (logger.isDebugEnabled()) {
                logger.debug("Found location [" + location + "] in " + wsdlResource);
            }
View Full Code Here

        expected = resource.lastModified();
    }

    @Test
    public void testSaxSource() throws Exception {
        long result = LastModifiedHelper.getLastModified(new ResourceSource(resource));
        Assert.assertEquals("Invalid last modified", expected, result);
    }
View Full Code Here

    private Source nonamespaces;

    @Before
    public final void setUp() throws Exception {
        template = createTemplate();
        namespaces = new ResourceSource(new ClassPathResource("namespaces.xml", AbstractXPathTemplateTestCase.class));
        nonamespaces =
                new ResourceSource(new ClassPathResource("nonamespaces.xml", AbstractXPathTemplateTestCase.class));
    }
View Full Code Here

    public void setRequest(Resource request) {
        this.request = request;
    }

    public void echo() throws IOException {
        Source requestSource = new ResourceSource(request);
        StringResult result = new StringResult();
        getWebServiceTemplate().sendSourceAndReceiveToResult(requestSource, result);
        System.out.println();
        System.out.println(result);
        System.out.println();
View Full Code Here

    public void setRequest(Resource request) {
        this.request = request;
    }

    public void echo() throws IOException {
        Source requestSource = new ResourceSource(request);
        StringResult result = new StringResult();
        getWebServiceTemplate().sendSourceAndReceiveToResult(requestSource, result);
        System.out.println();
        System.out.println(result);
        System.out.println();
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.