BusFactory.setDefaultBus(bus);
URL wsdl = this.getClass().getResource("/wsdl_systest_databinding/jibx/hello_world.wsdl");
assertNotNull("We should have found the WSDL here. " , wsdl);
SOAPService ss = new SOAPService(wsdl, SERVICE_NAME);
Greeter port = ss.getSoapPort();
updateAddressPort(port, WSDL_PORT);
String resp;
ClientProxy.getClient(port).getInInterceptors().add(new LoggingInInterceptor());
ClientProxy.getClient(port).getOutInterceptors().add(new LoggingOutInterceptor());
resp = port.sayHi();
assertEquals("We should get the right response", "Bonjour", resp);
resp = port.greetMe("Willem");
assertEquals("We should get the right response", "Hello Willem", resp);
try {
port.greetMe("fault");
fail("Should have been a fault");
} catch (GreetMeFault ex) {
assertEquals("Some fault detail", ex.getFaultInfo().getGreetMeFaultDetail());
}
try {
port.pingMe();
fail("We expect exception here");
} catch (PingMeFault ex) {
FaultDetail detail = ex.getFaultInfo();
assertEquals("Wrong faultDetail major", detail.getMajor(), 2);
assertEquals("Wrong faultDetail minor", detail.getMinor(), 1);