Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
The moose likes Web Services and the fly likes set the webservice location dynamically Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "set the webservice location dynamically" Watch "set the webservice location dynamically" New topic

set the webservice location dynamically

tarik el berrak

Joined: Oct 06, 2006
Posts: 29
Hi all,

I want to generate my client classes using a wsdl file.
I have 3 environments (dev, hom, and prod) for my client linked to a 3 server environments and each server with a webservice wsdl in which only the location change.
I use the Wscompile (jaxrpc-ri.jar) ant task to generate my classes.

I want to externalize the wsdl location (ex : put a variable in wsdl location that I can set dynamically to use the desired webservice (dev, hom, prod).

the constructor generated is :

public TestNameServiceSoap_Stub(HandlerChain handlerChain) {
super(handlerChain); _setProperty(ENDPOINT_ADDRESS_PROPERTY,"http://SERVER-IP-ADDRESS/TestName.asmx");

what I want if possibe is something like :

public TestNameServiceSoap_Stub(HandlerChain handlerChain) {
super(handlerChain); _setProperty(ENDPOINT_ADDRESS_PROPERTY,VARIABLE_TO_BE_SET);
VARIABLE_TO_BE_SET can be read from a property file

Thank you in advance

SCJP 1.5<br />New Target (SCWCD 5)
I agree. Here's the link:
subject: set the webservice location dynamically
It's not a secret anymore!