assertNotNull(service);
String response1 = new String("Hello Milestone-");
String response2 = new String("Bonjour");
try {
Greeter greeter = service.getPort(portName, Greeter.class);
Client client = ClientProxy.getClient(greeter);
client.getEndpoint().getOutInterceptors().add(new TibcoSoapActionInterceptor());
client.getOutInterceptors().add(new LoggingOutInterceptor());
client.getInInterceptors().add(new LoggingInInterceptor());
EndpointInfo ei = client.getEndpoint().getEndpointInfo();
AddressType address = ei.getTraversedExtensor(new AddressType(), AddressType.class);
JMSNamingPropertyType name = new JMSNamingPropertyType();
JMSNamingPropertyType password = new JMSNamingPropertyType();
name.setName("java.naming.security.principal");
name.setValue("ivan");
password.setName("java.naming.security.credentials");
password.setValue("the-terrible");
address.getJMSNamingProperty().add(name);
address.getJMSNamingProperty().add(password);
for (int idx = 0; idx < 5; idx++) {
greeter.greetMeOneWay("test String");
String greeting = greeter.greetMe("Milestone-" + idx);
assertNotNull("no response received from service", greeting);
String exResponse = response1 + idx;
assertEquals(exResponse, greeting);
String reply = greeter.sayHi();
assertNotNull("no response received from service", reply);
assertEquals(response2, reply);
try {
greeter.pingMe();
fail("Should have thrown FaultException");
} catch (PingMeFault ex) {
assertNotNull(ex.getFaultInfo());
}
}