Apache CXF Client for Dynamic Endpoints
This worked for me.
String customerEndPoint = "https://localhost:8080/customerService/v1"
customerWebService = service.getCustomerWebServicePort();
((BindingProvider) customerWebService).getRequestContext()
.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
customerEndPoint);
Working in cxf 2.6.1
Client client = ClientProxy.getClient(port);
client.getRequestContext().put(Message.ENDPOINT_ADDRESS, "http://some-valid-endpoint") ;
Try the following:
MyWebServicesSoap port = service.getMyWebServicesSoap12();
BindingProvider provider = (BindingProvider) port;
provider.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, endpoint);
Alternatively, MyWebServices
might have other getXXX methods that take a URL for the WSDL location