uCosminexus Application Server, Web Service Development Guide

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

1.5.1 Format of Web services

Cosminexus supports the following formats of Web services:

The following subsections describe each of the above formats:

Organization of this subsection
(1) SOAP Web services using Web Service Implementation Classes
(2) SOAP Web services using Provider Implementation Classes
(3) RESTful Web Services (Web resource)

(1) SOAP Web services using Web Service Implementation Classes

The following figure shows the format of Web services using Web Service Implementation Classes:

Figure 1-5 Format of a SOAP Web service that uses a Web service implementation class

[Figure]

When using Web Service Implementation Classes, Web services can be realized only by implementing a Java method that corresponds with the operations of a WSDL. The automatically generated stubs execute complicated transformation, so for developing Web Services, you need not perform complicated programming such as using APIs to assemble XMLs that configure SOAP Messages.

Either the tool automatically generates the stubs or the JAX-WS engine dynamically generates the stubs. The WSDL is mandatory and can be automatically generated. Note that you will not be able to send and receive the SOAP Messages that are not included in the WSDL. You can create a Web service implementation class as a POJO and also as a class based on EJB.

(2) SOAP Web services using Provider Implementation Classes

The following figure shows the format of Web services using Provider Implementation Classes.

Figure 1-6 Format of a SOAP Web service that uses (1)Provider Implementation Classes

[Figure]

When using Provider Implementation Classes, you neither need stubs nor a WSDL, so Provider Implementation Classes are suitable for dynamically sending and receiving any SOAP Message. A Provider Implementation Class accepts an object marshaled by the JAX-WS engine as it is, and therefore for developing Web services, you must directly acquire values from XMLs that configure SOAP Messages using APIs, and then assemble the XMLs.

(3) RESTful Web Services (Web resource)

You can execute RESTful Web Services (Web resource) by implementing a resource class.

Figure 1-7 RESTful Web service (Web resource)

[Figure]

A resource class consists of a root resource class and sub resource class.

A root resource class is a Java class annotated with the Path annotation at the class level, whereas a sub-resource class is a Java class that is not annotated with the Path annotation at the class level.

You can implement any of the following methods in a resource class: