0

Im doing a (School) project where a Client should query several Servers, the servers each run the same webservice (In Axis2 1.5.4).

I think the stub-generation approach would be stupid in this case, so are there any smart ways to exploit the fact that each server is equal? Ive read a bit about the ServiceClient which seems to be the way to go, but i just want to get that confirmed / de-confirmed from someone with a bit of experience in the field.

Regards Sune

Sune1987
  • 155
  • 2
  • 10

1 Answers1

0

You could still use a Stub in this scenario. A Stub reference has a method called _getServiceClient() which gets you the associated ServiceClient object for that Stub. From there, you can call getOptions() on that ServiceClient and set any number of parameters on that Options instance. The method you are looking for to set the endpoint is setTo(EndpointReference). So putting that all together, here is the code:

stub._getServiceClient().getOptions().setTo(new EndpointReference(endpoint));
laz
  • 28,320
  • 5
  • 53
  • 50