Search in sources :

Example 21 with ActionCallback

use of org.springframework.ws.soap.addressing.client.ActionCallback in project camel by apache.

the class ConsumerWSAEndpointMappingRouteTest method testWSAddressingResolveActionMoreSpecif.

@Test
public void testWSAddressingResolveActionMoreSpecif() throws Exception {
    StreamSource source = new StreamSource(new StringReader(xmlBody));
    webServiceTemplate.sendSourceAndReceive(source, new ActionCallback(new URI("http://action2"), new Addressing10(), new URI("http://url2.to")), TestUtil.NOOP_SOURCE_EXTRACTOR);
    resultEndpointToMoreSpecific.expectedMinimumMessageCount(0);
    resultEndpointToMoreSpecific.assertIsSatisfied();
    resultEndpointActionMoreSpecific.expectedMinimumMessageCount(1);
    resultEndpointActionMoreSpecific.assertIsSatisfied();
}
Also used : SoapActionCallback(org.springframework.ws.soap.client.core.SoapActionCallback) ActionCallback(org.springframework.ws.soap.addressing.client.ActionCallback) StreamSource(javax.xml.transform.stream.StreamSource) StringReader(java.io.StringReader) Addressing10(org.springframework.ws.soap.addressing.version.Addressing10) URI(java.net.URI) Test(org.junit.Test)

Example 22 with ActionCallback

use of org.springframework.ws.soap.addressing.client.ActionCallback in project camel by apache.

the class ConsumerWSAEndpointMappingRouteTest method testWSAddressingActionResponseActions.

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

Example 23 with ActionCallback

use of org.springframework.ws.soap.addressing.client.ActionCallback in project camel by apache.

the class ConsumerWSAEndpointMappingRouteTest method testWSAddressingTo.

@Test
public void testWSAddressingTo() throws Exception {
    StreamSource source = new StreamSource(new StringReader(xmlBody));
    webServiceTemplate.sendSourceAndReceive(source, new ActionCallback(new URI("http://www.stockquotes.edu/does-not-matter"), new Addressing10(), new URI("http://myUniqueToUrl")), TestUtil.NOOP_SOURCE_EXTRACTOR);
    resultEndpointTo.expectedMinimumMessageCount(1);
    resultEndpointTo.assertIsSatisfied();
}
Also used : SoapActionCallback(org.springframework.ws.soap.client.core.SoapActionCallback) ActionCallback(org.springframework.ws.soap.addressing.client.ActionCallback) StreamSource(javax.xml.transform.stream.StreamSource) StringReader(java.io.StringReader) Addressing10(org.springframework.ws.soap.addressing.version.Addressing10) URI(java.net.URI) Test(org.junit.Test)

Example 24 with ActionCallback

use of org.springframework.ws.soap.addressing.client.ActionCallback in project camel by apache.

the class ConsumerWSAEndpointMappingRouteTest method testWSAddressingToAndAction.

@Test
public void testWSAddressingToAndAction() throws Exception {
    StreamSource source = new StreamSource(new StringReader(xmlBody));
    webServiceTemplate.sendSourceAndReceive(source, new ActionCallback(new URI("http://toAndAction"), new Addressing10(), new URI("http://url3.to")), TestUtil.NOOP_SOURCE_EXTRACTOR);
    resultEndpointToAndAction.expectedMinimumMessageCount(1);
    resultEndpointToAndAction.assertIsSatisfied();
}
Also used : SoapActionCallback(org.springframework.ws.soap.client.core.SoapActionCallback) ActionCallback(org.springframework.ws.soap.addressing.client.ActionCallback) StreamSource(javax.xml.transform.stream.StreamSource) StringReader(java.io.StringReader) Addressing10(org.springframework.ws.soap.addressing.version.Addressing10) URI(java.net.URI) Test(org.junit.Test)

Example 25 with ActionCallback

use of org.springframework.ws.soap.addressing.client.ActionCallback in project camel by apache.

the class ConsumerEndpointMappingResponseHandlingRouteTest method testTo.

@Test
public void testTo() throws Exception {
    StringWriter sw = new StringWriter();
    StreamResult result = new StreamResult(sw);
    webServiceTemplate.sendSourceAndReceiveToResult(getDefaultRequestSource(), new ActionCallback(new URI("http://action-does-not-matter-here"), new Addressing10(), new URI("http://url.to")), result);
    assertNotNull(result);
    TestUtil.assertEqualsIgnoreNewLinesSymbol(expectedResponse, sw.toString());
}
Also used : StringWriter(java.io.StringWriter) StreamResult(javax.xml.transform.stream.StreamResult) SoapActionCallback(org.springframework.ws.soap.client.core.SoapActionCallback) ActionCallback(org.springframework.ws.soap.addressing.client.ActionCallback) Addressing10(org.springframework.ws.soap.addressing.version.Addressing10) URI(java.net.URI) Test(org.junit.Test)

Aggregations

ActionCallback (org.springframework.ws.soap.addressing.client.ActionCallback)32 Test (org.junit.Test)29 URI (java.net.URI)21 SoapActionCallback (org.springframework.ws.soap.client.core.SoapActionCallback)11 StringReader (java.io.StringReader)9 StreamSource (javax.xml.transform.stream.StreamSource)9 Addressing10 (org.springframework.ws.soap.addressing.version.Addressing10)8 SoapFaultClientException (org.springframework.ws.soap.client.SoapFaultClientException)6 Ignore (org.junit.Ignore)4 StringWriter (java.io.StringWriter)2 StreamResult (javax.xml.transform.stream.StreamResult)2 EndpointReference (org.springframework.ws.soap.addressing.core.EndpointReference)2 DocumentBuilder (javax.xml.parsers.DocumentBuilder)1 DOMResult (javax.xml.transform.dom.DOMResult)1 DOMSource (javax.xml.transform.dom.DOMSource)1 WebServiceTemplate (org.springframework.ws.client.core.WebServiceTemplate)1 Document (org.w3c.dom.Document)1 Element (org.w3c.dom.Element)1