Search in sources :

Example 1 with SoapActionCallback

use of org.springframework.ws.soap.client.core.SoapActionCallback in project camel by apache.

the class ConsumerEndpointMappingRouteTest method testSoapAction.

@Test
public void testSoapAction() throws Exception {
    webServiceTemplate.sendSourceAndReceive(getDefaultXmlRequestSource(), new SoapActionCallback("http://www.stockquotes.edu/GetQuote"), NOOP_SOURCE_EXTRACTOR);
    resultEndpointSoapAction.expectedMinimumMessageCount(1);
    resultEndpointSoapAction.assertIsSatisfied();
}
Also used : SoapActionCallback(org.springframework.ws.soap.client.core.SoapActionCallback) Test(org.junit.Test)

Example 2 with SoapActionCallback

use of org.springframework.ws.soap.client.core.SoapActionCallback in project camel by apache.

the class ConsumerWSAEndpointMappingRouteTest method testClassicalSoapHttpHeaderInterference.

@Test
public void testClassicalSoapHttpHeaderInterference() throws Exception {
    StreamSource source = new StreamSource(new StringReader(xmlBody));
    webServiceTemplate.sendSourceAndReceive(source, new SoapActionCallback("http://www.stockquotes.edu/soapHttpHeaderAction"), TestUtil.NOOP_SOURCE_EXTRACTOR);
    resultSoapAction.expectedMinimumMessageCount(1);
    resultSoapAction.assertIsSatisfied();
}
Also used : SoapActionCallback(org.springframework.ws.soap.client.core.SoapActionCallback) StreamSource(javax.xml.transform.stream.StreamSource) StringReader(java.io.StringReader) Test(org.junit.Test)

Example 3 with SoapActionCallback

use of org.springframework.ws.soap.client.core.SoapActionCallback in project webservices-axiom by apache.

the class SoapActionTest method runTest.

@Override
protected void runTest() throws Throwable {
    DocumentBuilder documentBuilder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
    Document requestDocument = documentBuilder.newDocument();
    Element request = requestDocument.createElementNS("urn:test", "p:Echo");
    request.setTextContent("Hello");
    Document responseDocument = documentBuilder.newDocument();
    context.getBean(WebServiceTemplate.class).sendSourceAndReceiveToResult(new DOMSource(request), new SoapActionCallback("http://www.example.com/echo"), new DOMResult(responseDocument));
    Element response = responseDocument.getDocumentElement();
    assertEquals("urn:test", response.getNamespaceURI());
    assertEquals("Echo", response.getLocalName());
    assertEquals("Hello", response.getTextContent());
}
Also used : DOMSource(javax.xml.transform.dom.DOMSource) SoapActionCallback(org.springframework.ws.soap.client.core.SoapActionCallback) DOMResult(javax.xml.transform.dom.DOMResult) DocumentBuilder(javax.xml.parsers.DocumentBuilder) Element(org.w3c.dom.Element) Document(org.w3c.dom.Document) WebServiceTemplate(org.springframework.ws.client.core.WebServiceTemplate)

Example 4 with SoapActionCallback

use of org.springframework.ws.soap.client.core.SoapActionCallback in project camel by apache.

the class ConsumerEndpointMappingResponseHandlingRouteTest method testSoapAction.

@Test
public void testSoapAction() throws Exception {
    StringWriter sw = new StringWriter();
    StreamResult result = new StreamResult(sw);
    webServiceTemplate.sendSourceAndReceiveToResult(getDefaultRequestSource(), new SoapActionCallback("http://www.webserviceX.NET/GetQuote"), result);
    assertNotNull(result);
    TestUtil.assertEqualsIgnoreNewLinesSymbol(expectedResponse, sw.toString());
}
Also used : SoapActionCallback(org.springframework.ws.soap.client.core.SoapActionCallback) StringWriter(java.io.StringWriter) StreamResult(javax.xml.transform.stream.StreamResult) Test(org.junit.Test)

Example 5 with SoapActionCallback

use of org.springframework.ws.soap.client.core.SoapActionCallback in project camel by apache.

the class ConsumerEndpointMappingRouteTest method testWrongSoapAction.

@Test(expected = WebServiceIOException.class)
public void testWrongSoapAction() throws Exception {
    webServiceTemplate.sendSourceAndReceive(getDefaultXmlRequestSource(), new SoapActionCallback("http://this-is-a-wrong-soap-action"), NOOP_SOURCE_EXTRACTOR);
    resultEndpointSoapAction.assertIsNotSatisfied();
}
Also used : SoapActionCallback(org.springframework.ws.soap.client.core.SoapActionCallback) Test(org.junit.Test)

Aggregations

SoapActionCallback (org.springframework.ws.soap.client.core.SoapActionCallback)6 Test (org.junit.Test)4 DocumentBuilder (javax.xml.parsers.DocumentBuilder)2 DOMResult (javax.xml.transform.dom.DOMResult)2 DOMSource (javax.xml.transform.dom.DOMSource)2 WebServiceTemplate (org.springframework.ws.client.core.WebServiceTemplate)2 Document (org.w3c.dom.Document)2 Element (org.w3c.dom.Element)2 StringReader (java.io.StringReader)1 StringWriter (java.io.StringWriter)1 StreamResult (javax.xml.transform.stream.StreamResult)1 StreamSource (javax.xml.transform.stream.StreamSource)1