I am writing a CXF client. Now I need to integrate security. I have these classes created from wsdl2java: MyService , MyServiceProxy , MyServiceHttpBindingStub , MyServiceHttpService and MyServiceHttpServiceLocator .
So far, I have used the MyServiceProxy class for service requests. Following the tutorial, I have to somehow get an Endpoint so that I can do this:
endpoint.getOutInterceptors().add(wssOut);
The guide explains using the ClientProxy helper class as follows:
Client client = ClientProxy.getClient(port); Endpoint endpoint = client.getEndpoint();
But how to create port from my classes? When I do this:
MyService port = (new MyServiceHttpServiceLocator()).getMyServiceHttpPort();
and put this port in the ClientProxy method, I get a runtime error:
java.lang.IllegalArgumentException: not a proxy instance
So, how can I get the port so that I can pass it to ClientProxy.getClient() ?
comco source share