-
1. Re: how to dynamically change URL where client is connecting
asoldano Nov 14, 2007 3:02 PM (in response to sodik)If you only need to use different endpoints (with different addresses) and the services publish the same wsdl contract, just use this before the invocation:
((BindingProvider)myPort).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, endpoint);
where "endpoint" is your runtime selected endpoint address. -
2. Re: how to dynamically change URL where client is connecting
sodik Nov 21, 2007 10:15 AM (in response to sodik)thank you, looks exactly as what I need.
-
3. Re: how to dynamically change URL where client is connecting
piwaf May 10, 2013 12:25 PM (in response to asoldano)This does exactly what I need, Stub created against a Dev URL but in Production want to call production url based on url in a config setup. But is there not a more straight forward way to do this? It just seems like such a basic need that I'm confused on why it appears the only way to change it is a "back door".
I have tried using the wsdlLocation parameter of the generated Service Constructor, aka the Service.create call, and that seems to affect where it gets the WSDL from for validation, but it doesn't seem to affect where the call is actually made. That call still defaults to the url in the port section of the original wsdl used to generate the client stub.
Am I doing something wring or is this just how it is?