To add some clarification, when you create your service, the service class uses the standard wsdlLocation, which was inserted into it when the class was built from wsdl. Therefore, if you have a service class named SomeService, and you create an instance similar to the following:
SomeService someService = new SomeService();
If you look inside SomeService, you will see that the constructor looks like this:
public SomeService() { super(__getWsdlLocation(), SOMESERVICE_QNAME); }
So, if you want it to point to a different URL, you simply use a constructor that takes a URL argument (there are also 6 constructors for setting qname and functions). For example, if you configured a local TCP / IP monitor that listens on port 9999, and you want to redirect to this URL:
URL newWsdlLocation = new URL("http://theServerName:9999/somePath"); SomeService someService = new SomeService(newWsdlLocation);
and this will call this constructor inside the service:
public SomeService(URL wsdlLocation) { super(wsdlLocation, SOMESERVICE_QNAME); }
MattC Mar 19 '15 at 23:31 2015-03-19 23:31
source share