String contextPath = webAppRoot + "/ServiceGroup";
URI address = getLocalAddress(contextPath, port);
EndpointReference epr = new EndpointReference(address);
ServiceGroupClient sg = new ServiceGroupClient(epr);
//
// ping SG, wait a few seconds, then check for members
// that were added by the simulation factory
//
System.out.println("Pinging Muse to initialize the endpoint...");
sg.getResourcePropertyDocument();
System.out.println("Waiting 10 seconds while simulation creates WS-resources...");
Thread.currentThread().sleep(10000);
System.out.println("Done waiting - reading service group entries...");
//
// turn on tracing of SOAP messages
//
sg.setTrace(true);
WsResourceClient[] members = sg.getMembers();
System.out.println("Addresses of each service group entry:\n");
for (int n = 0; n < members.length; ++n)
System.out.println(members[n].getEndpointReference().getAddress());