This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
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


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "set the webservice location dynamically" Watch "set the webservice location dynamically" New topic
Author

set the webservice location dynamically

tarik el berrak
Greenhorn

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)
 
 
subject: set the webservice location dynamically