@Test
public void testInvokingServiceFromCXFClient() throws Exception {
URL wsdlURL = getClass().getClassLoader().getResource("person-non-wrapper.wsdl");
PersonService ss = new PersonService(wsdlURL, new QName("http://camel.apache.org/non-wrapper", "PersonService"));
Person client = ss.getSoap();
((BindingProvider)client).getRequestContext()
.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
"http://localhost:" + port1 + "/CxfNonWrapperTest/PersonService/");
GetPerson request = new GetPerson();
request.setPersonId("hello");
GetPersonResponse response = client.getPerson(request);
assertEquals("we should get the right answer from router", "Bonjour", response.getName());
request.setPersonId("");
try {
client.getPerson(request);
fail("We expect to get the UnknowPersonFault here");
} catch (UnknownPersonFault fault) {
// We expect to get fault here
}
}