We have a central WSDL file that describes a web service. We use CXF to generate client code, but this code seems to be bound to 1 endpoint. How can i create a CXF client that uses the WSDL, but where I can specify the endpoint? Is there are way in changing the endpoint to a URL that implements the same WSD:?
If the other
service implements the same WSDL, when you create the MyClientService
object, you can pass the URL to the new service's WSDL right to the constructor and it will us it. Most services would expose its wsdl on ?wsdl so using that may "just work".
Alternatively, you can override the endpoint URL via:
((BindingProvider)proxy).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_URL, "http://my.service.url.com/...")
where proxy
is the MyClientService
object.