Sunday 15 January 2012

Changing CXF WebService address

In the Apache CXF we do not have a constructor to create web service with local wsdl file or address to the web service which would override the default one. But we can do it on the constructed object. Here is an example:
WebServicesSoap port = service.getWebServicesSoap();
BindingProvider bindingProvider = (BindingProvider) port;
bindingProvider.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, webServiceAddress); 

No comments: