Package org.springframework.xml.transform

Examples of org.springframework.xml.transform.StringSource


  @Test
    public void fault() {
        Result result = new StringResult();
        try {
            template.sendSourceAndReceiveToResult(baseUrl + "/soap/fault", new StringSource(messagePayload),
                    result);
            Assert.fail("SoapFaultClientException expected");
        }
        catch (SoapFaultClientException ex) {
            //expected
View Full Code Here


        Result result = new StringResult();
        template.setCheckConnectionForFault(false);
        template.setCheckConnectionForError(false);
        try {
            template.sendSourceAndReceiveToResult(baseUrl + "/soap/badRequestFault",
                    new StringSource(messagePayload), result);
            Assert.fail("SoapFaultClientException expected");
        }
        catch (SoapFaultClientException ex) {
            //expected
        }
View Full Code Here

        }
    }

  @Test
    public void attachment() {
        template.sendSourceAndReceiveToResult(baseUrl + "/soap/attachment", new StringSource(messagePayload),
                new WebServiceMessageCallback() {

                    @Override
                    public void doWithMessage(WebServiceMessage message) throws IOException, TransformerException {
                        SoapMessage soapMessage = (SoapMessage) message;
View Full Code Here

  @Test
    public void sendSourceAndReceiveToResult() throws SAXException, IOException {
        StringResult result = new StringResult();
        boolean b = template.sendSourceAndReceiveToResult(baseUrl + "/soap/echo",
                new StringSource(messagePayload), result);
        Assert.assertTrue("Invalid result", b);
        assertXMLEqual(messagePayload, result.toString());
    }
View Full Code Here

    }

  @Test
    public void sendSourceAndReceiveToResultNoResponse() {
        boolean b = template.sendSourceAndReceiveToResult(baseUrl + "/soap/noResponse",
                new StringSource(messagePayload), new StringResult());
        Assert.assertFalse("Invalid result", b);
    }
View Full Code Here

            @Override
            public void marshal(Object graph, Result result) throws XmlMappingException, IOException {
                Assert.assertEquals("Invalid object", graph, requestObject);
                try {
                    transformer.transform(new StringSource(messagePayload), result);
                }
                catch (TransformerException e) {
                    Assert.fail(e.getMessage());
                }
            }
View Full Code Here

            @Override
            public void marshal(Object graph, Result result) throws XmlMappingException, IOException {
                Assert.assertEquals("Invalid object", graph, requestObject);
                try {
                    transformer.transform(new StringSource(messagePayload), result);
                }
                catch (TransformerException e) {
                    Assert.fail(e.getMessage());
                }
            }
View Full Code Here

  @Test
    public void notFound() {
        try {
            template.sendSourceAndReceiveToResult(baseUrl + "/errors/notfound",
                    new StringSource(messagePayload), new StringResult());
            Assert.fail("WebServiceTransportException expected");
        }
        catch (WebServiceTransportException ex) {
            //expected
        }
View Full Code Here

  @Test
    public void receiverFault() {
        Result result = new StringResult();
        try {
            template.sendSourceAndReceiveToResult(baseUrl + "/soap/receiverFault", new StringSource(messagePayload),
                    result);
            Assert.fail("SoapFaultClientException expected");
        }
        catch (SoapFaultClientException ex) {
            //expected
View Full Code Here

  @Test
    public void senderFault() {
        Result result = new StringResult();
        try {
            template.sendSourceAndReceiveToResult(baseUrl + "/soap/senderFault", new StringSource(messagePayload),
                    result);
            Assert.fail("SoapFaultClientException expected");
        }
        catch (SoapFaultClientException ex) {
            //expected
View Full Code Here

TOP

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

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.