public void testBasicInvocation() throws Exception {
ByteArrayOutputStream input = setupInLogging();
ByteArrayOutputStream output = setupOutLogging();
Response<AddNumbersResponse> resp;
AddNumbersPortType port = getPort();
((BindingProvider)port).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
"http://localhost:" + PORT + "/jaxws/add");
assertEquals(3, port.addNumbers(1, 2));
String base = "http://apache.org/cxf/systest/ws/addr_feature/AddNumbersPortType/";
String expectedOut = base + "addNumbersRequest</Action>";
String expectedIn = base + "addNumbersResponse</Action>";
assertTrue(output.toString().indexOf(expectedOut) != -1);
assertTrue(input.toString().indexOf(expectedIn) != -1);
resp = port.addNumbers3Async(1, 2);
assertEquals(3, resp.get().getReturn());
((BindingProvider)port).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
"http://localhost:" + PORT + "/doesntexist");
resp = port.addNumbers3Async(1, 2);
try {
resp.get();
} catch (ExecutionException ex) {
assertTrue("Found " + ex.getCause().getClass(), ex.getCause() instanceof IOException);
Client c = ClientProxy.getClient(port);