LibraryToggle FramesPrintFeedback

The WS client proxy is an object that converts Java method invocations to remote procedure calls, sending and receiving messages to a remote instance of the Web service across the network. The methods of the proxy are exposed through the SEI.


The proxy type is generated dynamically by Apache CXF at run time. That is, their is no class in the stub code that corresponds to the implementation of the proxy (the only relevant entity is the SEI, which defines the proxy's interface).

To implement and build the sample WS client shown in Figure 4.1, starting from scratch, you would perform the following steps:

  1. Obtain a copy of the WSDL contract.

  2. Generate the Java stub code from the WSDL contract using a WSDL-to-Java converter, ws2java. This gives you the SEI, CustomerService, and its related classes, such as Customer.

  3. Implement the main client class, ClientInvoker, which invokes the Web service operations. In this class define a bean property of type, CustomerService, so that the client class can receive a reference to the WS client proxy by property injection.

  4. In a Spring XML file, instantiate the WS client proxy and inject it into the main client class, ClientInvoker.

Comments powered by Disqus