Search in sources :

Example 6 with ActionCallback

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

the class AbstractConsumerTests method onlyCustomOutputSpecified4fault.

@Test
public void onlyCustomOutputSpecified4fault() throws Exception {
    ActionCallback requestCallback = channelIn("http://uriOutputOnly-fault.com/");
    try {
        webServiceTemplate.sendSourceAndReceiveToResult(source, requestCallback, result);
    } catch (SoapFaultClientException e) {
    // ok - cause fault response
    }
    Assertions.assertThat(channelOut().getAction()).isEqualTo(getDefaultResponseAction());
}
Also used : ActionCallback(org.springframework.ws.soap.addressing.client.ActionCallback) SoapFaultClientException(org.springframework.ws.soap.client.SoapFaultClientException) Test(org.junit.Test)

Example 7 with ActionCallback

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

the class AbstractConsumerTests method onlyCustomFaultSpecified4fault.

@Test
public void onlyCustomFaultSpecified4fault() throws Exception {
    ActionCallback requestCallback = channelIn("http://uriFaultOnly-fault.com/");
    try {
        webServiceTemplate.sendSourceAndReceiveToResult(source, requestCallback, result);
    } catch (SoapFaultClientException e) {
    // ok - cause fault response
    }
    Assertions.assertThat(channelOut().getAction()).isEqualTo(new URI("http://customURIFaultAction"));
}
Also used : ActionCallback(org.springframework.ws.soap.addressing.client.ActionCallback) SoapFaultClientException(org.springframework.ws.soap.client.SoapFaultClientException) URI(java.net.URI) Test(org.junit.Test)

Example 8 with ActionCallback

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

the class AbstractConsumerTests method overrideHeaderAction4fault.

@Test
@Ignore(value = "Not implemented yet")
public void overrideHeaderAction4fault() throws Exception {
    ActionCallback requestCallback = channelIn("http://override-fault.com");
    try {
        webServiceTemplate.sendSourceAndReceiveToResult(source, requestCallback, result);
    } catch (SoapFaultClientException e) {
    // ok - cause fault response
    }
    Assertions.assertThat(channelOut().getAction()).isEqualTo(new URI("http://faultHeader.com"));
}
Also used : ActionCallback(org.springframework.ws.soap.addressing.client.ActionCallback) SoapFaultClientException(org.springframework.ws.soap.client.SoapFaultClientException) URI(java.net.URI) Ignore(org.junit.Ignore) Test(org.junit.Test)

Example 9 with ActionCallback

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

the class AbstractConsumerTests method customAction4output.

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

Example 10 with ActionCallback

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

the class AbstractConsumerTests method customAction4fault.

@Test
public void customAction4fault() throws Exception {
    ActionCallback requestCallback = channelIn("http://uri-fault.com");
    try {
        webServiceTemplate.sendSourceAndReceiveToResult(source, requestCallback, result);
    } catch (SoapFaultClientException e) {
    // ok - cause fault response
    }
    Assertions.assertThat(channelOut().getAction()).isEqualTo(new URI("http://customURIFaultAction"));
}
Also used : ActionCallback(org.springframework.ws.soap.addressing.client.ActionCallback) SoapFaultClientException(org.springframework.ws.soap.client.SoapFaultClientException) 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