Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

set the webservice location dynamically

 
tarik el berrak
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic