Search in sources :

Example 16 with ActionCallback

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

the class CamelDirectSenderTest method endpointSender.

@Test
public void endpointSender() throws Exception {
    ActionCallback requestCallback = channelIn("http://sender-default.com");
    webServiceTemplate.sendSourceAndReceiveToResult(source, requestCallback, result);
    Assertions.assertThat(channelOut().getTo()).isEqualTo(new URI("mailto:andrej@chocolatejar.eu"));
    Assertions.assertThat(endpointCamelDirect.getReceivedCounter()).isZero();
}
Also used : ActionCallback(org.springframework.ws.soap.addressing.client.ActionCallback) URI(java.net.URI) Test(org.junit.Test)

Example 17 with ActionCallback

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

the class CamelDirectSenderTest method customSender.

@Test
public void customSender() throws Exception {
    ActionCallback requestCallback = channelIn("http://sender-custom.com");
    webServiceTemplate.sendSourceAndReceiveToResult(source, requestCallback, result);
    Assertions.assertThat(customChannelParams().getTo()).isEqualTo(new URI("mailto:andrej@chocolatejar.eu"));
    Assertions.assertThat(endpointCamelDirect.getReceivedCounter()).isZero();
}
Also used : ActionCallback(org.springframework.ws.soap.addressing.client.ActionCallback) URI(java.net.URI) Test(org.junit.Test)

Example 18 with ActionCallback

use of org.springframework.ws.soap.addressing.client.ActionCallback in project webservices-axiom by apache.

the class WSAddressingDOMTest method runTest.

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

Example 19 with ActionCallback

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

the class AbstractConsumerTests method headerAction4output.

@Test
@Ignore(value = "Not implemented yet")
public void headerAction4output() throws Exception {
    ActionCallback requestCallback = channelIn("http://headerOnly-ok.com");
    webServiceTemplate.sendSourceAndReceiveToResult(source, requestCallback, result);
    Assertions.assertThat(channelOut().getAction()).isEqualTo(new URI("http://outputHeader.com"));
}
Also used : ActionCallback(org.springframework.ws.soap.addressing.client.ActionCallback) URI(java.net.URI) Ignore(org.junit.Ignore) Test(org.junit.Test)

Example 20 with ActionCallback

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

the class ConsumerWSAEndpointMappingRouteTest method testWSAddressingResolveToMoreSpecif.

@Test
public void testWSAddressingResolveToMoreSpecif() throws Exception {
    StreamSource source = new StreamSource(new StringReader(xmlBody));
    webServiceTemplate.sendSourceAndReceive(source, new ActionCallback(new URI("http://action1"), new Addressing10(), new URI("http://url1.to")), TestUtil.NOOP_SOURCE_EXTRACTOR);
    resultEndpointToMoreSpecific.expectedMinimumMessageCount(1);
    resultEndpointToMoreSpecific.assertIsSatisfied();
    resultEndpointActionMoreSpecific.expectedMinimumMessageCount(0);
    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)

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