Hi Dan
I am also trying configure the endpoints, at the moment they are
hardcoded and got as follows
DocServiceClient webService = new DocServiceClient();
DocServicePortType docClient =
webService.getDocServiceHttpPort();
I presume my lines would be like This line I am unsure about where is
the definition for "Proxy" in
DocServiceClient webService = new DocServiceClient();
Client client = ((XFireProxy)
Proxy.getInvocationHandler(webService)).getClient();
client.setUrl("http://dest.host.com");
DocServicePortType docClient = webService.getDocServiceHttpPort();
Regards
Frank
Dan Diephouse wrote:
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