2

How can I change the webservice endpoint URL of a webservice client generated by the netbeans wizard (webservice client from wdsl URL ).

I tried to change the webservice endpoint by both methods given in this question Change WebService endpoint address at run time .

Somehow both methods don't work in my situation. The webservice endpoint stays the same even if I give an URL with a non existing or empty host name in it. It still refers to my testing webservice running on the glassfish server in netbeans, and succesfully loads data from the webservice.

I tried to clean and rebuild all the involved code to make sure that there is no mistake there. I tried to use the debugger to make sure that the endpoint URL is changed for the webservice, but I can't seem to find where this variable is located in service or port class.

Who has an idea of what is going wrong?

Community
  • 1
  • 1
WillamS
  • 2,457
  • 6
  • 24
  • 23

2 Answers2

1

Check that you are providing a correct ENDPOINT_ADDRESS_PROPERTY and not the WSDL URL.

hkutluay
  • 6,794
  • 2
  • 33
  • 53
Rafael
  • 11
  • 1
1

One of the solutions given in the mentioned question is now working for me. I don't know what I changed to make this work.

BindingProvider bp = (BindingProvider) port;
    bp.getRequestContext().put(
            BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
            "http://" + ip + ":8080/myWebservice/myWebservice?wsdl");
WillamS
  • 2,457
  • 6
  • 24
  • 23