ByteArrayOutputStream input = setupInLogging();
ByteArrayOutputStream output = setupOutLogging();
URL wsdl = getClass().getResource("/wsdl_systest_wsspec/add_numbers.wsdl");
assertNotNull("WSDL is null", wsdl);
AddNumbersService service = new AddNumbersService(wsdl, serviceName);
Dispatch<Source> disp = service.createDispatch(AddNumbersService.AddNumbersPort,
Source.class, Mode.PAYLOAD);
disp.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
"http://localhost:" + PORT + "/jaxws/add");
//manually set the action
disp.getRequestContext().put(BindingProvider.SOAPACTION_URI_PROPERTY,
expectedOut);
disp.invoke(new StreamSource(new StringReader(req)));
assertTrue(output.toString().indexOf(expectedOut) != -1);
assertTrue(input.toString().indexOf(expectedIn) != -1);
output.reset();
input.reset();
disp = service.createDispatch(AddNumbersService.AddNumbersPort,
Source.class, Mode.PAYLOAD);
disp.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
"http://localhost:" + PORT + "/jaxws/add");