uCosminexus Application Server, Web Service Development Guide

[Contents][Glossary][Index][Back][Next]

1.5.2 Format of clients

Cosminexus supports the following forms of clients to call the SOAP Web services:

The following section describes each format.

Note that you must use either the client APIs for RESTful Web Services or standard Java APIs such as java.net.URL or java.net.HttpURLConnection to implement a Web resource client.

Organization of this subsection
(1) Stub-based Web Service clients
(2) Dispatch-based Web Service clients

(1) Stub-based Web Service clients

The following figure shows the format using a stub-based Web Service client:

Figure 1-8 Web Service client (Stub-based)

[Figure]

When using stub-based Web Service clients, Web services can be invoked only by invoking the Java method that corresponds with the operations of a WSDL. The automatically generated stubs execute complicated transformation, so for developing Web Service clients you need not perform complicated programming such as using APIs to assemble XMLs configuring SOAP Messages. However, note that it is not possible to send and receive SOAP Messages that are not defined in the WSDL. Also, the stubs and WSDL will be required. You must acquire a WSDL from the corresponding Web Service.

(2) Dispatch-based Web Service clients

The following figure shows the format using dispatch-based Web Service clients:

Figure 1-9 Web Service client (Dispatch-based)

[Figure]

When using dispatch-based Web Service clients, you neither need stubs nor a WSDL, so dispatch-based Web Service clients are suitable for dynamically sending and receiving any SOAP Message. A dispatch-based Web Service client transfers the generated objects to the JAX-WS engine via the javax.xml.ws.Dispatch interface, and therefore, when developing a Web Service client, you must directly acquire values from XMLs and use APIs to assemble the XMLs configuring SOAP Messages.

Note
With the dispatch-based Web Service client, you can also send and receive SOAP Messages using the javax.xml.soap.SOAPConnection class instead of the javax.xml.ws.Dispatch interface. However, note that when you use the javax.xml.soap.SOAPConnection class, the settings of operation definition files and the message context are disabled and a log is also not output.
Also, this manual does not describe operations for using the javax.xml.soap.SOAPConnection class. For details, see the JDK documentation as you would for the other APIs of the SAAJ 1.3 specifications. If there is no problem, use the javax.xml.ws.Dispatch interface instead of the javax.xml.soap.SOAPConnection class.