public void testClientInvocation() throws Exception {
startUpServer();
Client client = new Client("http://localhost:9091/GreeterContext/GreeterPort");
Greeter port = client.getProxy();
assertNotNull("The proxy should not be null", port);
String resp = port.sayHi();
assertEquals("Get a wrong response ", "Bonjour from EndpointA", resp);
resp = port.sayHi();
assertEquals("Get a wrong response ", "Bonjour from EndpointB", resp);
resp = port.greetMe("Mike");
assertEquals("Get a wrong response ", "Hello Mike from EndpointA", resp);
resp = port.greetMe("James");
assertEquals("Get a wrong response ", "Hello James from EndpointB", resp);
port.greetMeOneWay(System.getProperty("user.name"));
try {
System.out.println("Invoking pingMe, expecting exception...");
port.pingMe("hello");
fail("expects the exception here");
} catch (PingMeFault ex) {
assertEquals("Get a wrong exception message", "PingMeFault raised by server EndpointB", ex.getMessage());
FaultDetail detail = ex.getFaultInfo();
assertEquals("Wrong FaultDetail major:", 2, detail.getMajor());