Hi All,
I am pretty new to web services. Currently in our application one of the requirement is to fetch data from a web service.
This web service has published a WSDL. We run a clientgen utility against this WSDL to create a set of
java related artifacts for this web service.
Then in our application we use these web service generated java classes.
This was working fine. Now the problem is as we go about
testing across various environments the web service provider URL will keep on changing.
The approach we follow now is manually change the endpoint url in our copy of wsdl & regenerate the entire set of java classes.
We want to avoid this task of repeateadly using clientgen to generate the same set of java artifacts just to accomodate a mere change of web service provider endpoint url.
So we want to set this endpoint url in our code where in we specify the endpoint url say in properties file.
I tried a few options which I got on the net but none seems to work successfully something like this
--------------------------------------------------------
// Invoke createProxy() to create a stub object
Stub stub = createProxy();
// Set the endpoint address the stub uses to access the service
stub._setProperty(javax.xml.rpc.Stub.ENDPOINT_ADDRESS_PROPERTY,
"http://localhost:8080/math-service/math");
-------------------------------------------------------------
Can someone tell me what would be the right way of doing this.
Regards