Rahul Pilani wrote:
Hi All,
I am using the wsgen task to create a client to an existing XFire
Server. The task works fine, but it hardcodes the parameters from the
WSDL into the java files. Is there a way to opening up the Client so
that you can configure the endpoints at a later stage? I have this
requirement because we have 3 different environments for both the
server and the client, and the urls for both can change depending on
the environment. Ideally we would want to generate the java files only
once per interface change.
Thanks,
Rahul
Yes, this is easily accomplished:
Echo echo = .... // this is your echo client
// now get the underlying Client class:
Client client = ((XFireProxy) Proxy.getInvocationHandler(echo)).getClient();
// set the url
client.setUrl("http://dest.host.com");
Hope that helps.
- Dan
--
Dan Diephouse
Envoi Solutions
http://envoisolutions.com
http://netzooid.com/blog