JAX WS Change Endpoint

ยท
5 min read
notes
#java #jaxws

Change a web service endpoint.

Consider that we defined a web service:

MyServicePortType service = new MyServiceService().getMyServicePortType();

Normally, we would go on and put the param at the service. Not yet, change the address first:

BindingProvider bindingProvider = (BindingProvider) service;
bindingProvider.getRequestContext().put(
BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
"http://new.server/endpoint"
);

SOURCE: stackoverflow

Now, do other thing as usual.