I'm having a problem when using multiple servers in java ws.
All of this servers provide the same WebService but they have different names and IPs.
I'm using UDDI.
My goal is for the client to contact all the servers that are executing that service when performing a request.
Should I do this through a handler or is there another way?
SDStore port =service.getSDStoreImplPort();
String uddiURL = args[0];
String name = args[1];
Integer nrRep = Integer.parseInt(args[2]);
System.out.printf("Contacting UDDI at %s%n", uddiURL);
UDDINaming uddiNaming = new UDDINaming(uddiURL);
System.out.printf("Looking for '%s'%n", name);
Vector<String> repsAdd = new Vector<String>();
for(;nrRep>=1;nrRep--){
repsAdd.add(uddiNaming.lookup(name + nrRep));
System.out.printf(name+nrRep);
}
uddiNaming.lookup(name);
System.out.println("Creating stub ...");
// ...
System.out.println("Setting endpoint address ...");
BindingProvider bindingProvider = (BindingProvider) port;
Map<String, Object> requestContext = bindingProvider.getRequestContext();
requestContext.put(ENDPOINT_ADDRESS_PROPERTY, repsAdd.elementAt(0));
// Start Store
StoreM g = new StoreM(port);
I know that through the port instruction I get the interface for this service, but how can I configure the requestContext?
I assume this is what I need to change...