Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Name

Value

clientFactoryBean

The ClientFactoryBean used in construction of this proxy.

password

The password which the transport should use.

username

The username which the transport should use.

wsdlURL

The wsdl the client should use to configure itself.

Configuring an Endpoint/Client Proxy Using CXF APIs

JAX-WS endpoints and client proxies are implemented on top of CXF's frontend-neutral endpoint API. You can therefore use CXF APIs to enhance the functionality of a JAX-WS endpoint or client proxy, for example by adding interceptors.

To cast a client proxy to a CXF client:

Code Block
java
java

GreeterService gs = new GreeterService();
Greeter greeter = gs.getGreeterPort();

org.apache.cxf.endpoint.Client client = 
org.apache.cxf.frontend.ClientProxy.getClient(greeter); 
org.apache.cxf.endpoint.Endpoint cxfEndpoint = client.getEndpoint();
cxfEndpoint.getOutInterceptors().add(...);

To cast a JAX-WS endpoint to a CXF server:

Code Block
java
java

javax.xml.ws.Endpoint jaxwsEndpoint = javax.xml.ws.Endpoint.publish("http://localhost:9020/SoapContext/GreeterPort", new GreeterImpl(););
org.apache.cxf.jaxws.EndpointImpl jaxwsEndpointImpl = (org.apache.cxf.jaxws.EndpointImpl)endpoint;
org.apache.cxf.endpoint.Server server = jaxwsEndpointImpl.getServer();
org.apache.cxf.endpoint.Endpoint cxfEndpoint = server.getEndpoint();
cxfEndpoint.getOutInterceptors().add(...);
org.apache.cxf.service.Service cxfService = cxfEndpoint.getService();
cxfService.getOutInterceptors().add(...);