use of org.springframework.ws.soap.client.SoapFaultClientException 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());
}
use of org.springframework.ws.soap.client.SoapFaultClientException 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"));
}
use of org.springframework.ws.soap.client.SoapFaultClientException 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"));
}
use of org.springframework.ws.soap.client.SoapFaultClientException 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"));
}
use of org.springframework.ws.soap.client.SoapFaultClientException in project webservices-axiom by apache.
the class BrokerScenarioTest method runTest.
@Override
protected void runTest() throws Throwable {
BrokerClient client = context.getBean(BrokerClient.class);
Order order = new Order();
order.setCustomer(47892);
Order.Item item1 = new Order.Item();
item1.setStock("GOOG");
item1.setCount(100);
Order.Item item2 = new Order.Item();
item2.setStock("MSFT");
item2.setCount(10);
order.setItems(new Order.Item[] { item1, item2 });
OrderStatus status = client.order(order);
assertNotNull(status.getReceived());
Order receivedOrder = client.receiveNextOrder();
assertNotNull(receivedOrder);
assertEquals(order.getCustomer(), receivedOrder.getCustomer());
assertEquals(order.getItems().length, receivedOrder.getItems().length);
assertEquals(order.getItems()[0].getStock(), receivedOrder.getItems()[0].getStock());
assertEquals(order.getItems()[0].getCount(), receivedOrder.getItems()[0].getCount());
order.setCustomer(23629);
// SOAP 1.2 fault processing is locale dependent
Locale oldLocale = Locale.getDefault();
Locale.setDefault(Locale.ENGLISH);
try {
client.order(order);
fail("Expected SoapFaultClientException");
} catch (SoapFaultClientException ex) {
assertEquals(spec.getSenderFaultCode(), ex.getFaultCode());
assertEquals("Customer 23629 unknown", ex.getMessage());
} finally {
Locale.setDefault(oldLocale);
}
}
Aggregations