return true;
}
@Test
public void testSOAPMessageModeDocLit() throws Exception {
JaxwsTestHandler fromHandler = getMandatoryBean(JaxwsTestHandler.class, "fromEndpointJaxwsHandler");
fromHandler.reset();
QName serviceName =
new QName("http://apache.org/hello_world_soap_http", "SOAPProviderService");
QName portName =
new QName("http://apache.org/hello_world_soap_http", "SoapProviderPort");
URL wsdl = getClass().getResource("/wsdl/hello_world.wsdl");
assertNotNull(wsdl);
SOAPService service = new SOAPService(wsdl, serviceName);
assertNotNull(service);
String response1 = new String("TestSOAPOutputPMessage");
String response2 = new String("Bonjour");
try {
Greeter greeter = service.getPort(portName, Greeter.class);
((BindingProvider)greeter).getRequestContext()
.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
"http://localhost:" + port + "/CxfSoapMessageProviderTest/SoapContext/SoapProviderPort");
for (int idx = 0; idx < 2; idx++) {
String greeting = greeter.greetMe("Milestone-" + idx);
assertNotNull("no response received from service", greeting);
assertEquals(response1, greeting);
String reply = greeter.sayHi();
assertNotNull("no response received from service", reply);
assertEquals(response2, reply);
}
} catch (UndeclaredThrowableException ex) {
throw (Exception)ex.getCause();
}
assertEquals("Can't get the right message count", fromHandler.getMessageCount(), 8);
assertEquals("Can't get the right fault count", fromHandler.getFaultCount(), 0);
//From CXF 2.2.7 the soap handler's getHeader() method will not be called if the SOAP message don't have headers
//assertEquals("Can't get the right headers count", fromHandler.getGetHeadersCount(), 4);
}