uCosminexus Application Server, Web Service Development Guide

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

10.6 Issuing the Meta data

The JAX-WS engine on the Web Service can issue the WSDL file coding the Meta data of the Web Service (Web Service Implementation Class or Provider Implementation Class) according to the request. The issued WSDL file can be used to generate the Java code required for developing the Web Service and the Web Service client by using the cjwsimport command.

This section describes the points to be noted when Meta data issuing is used.

Organization of this section
(1) Conditions for issuing the Meta data
(2) Issued Meta data
(3) Updating the WSDL
(4) Enabling and disabling Meta data issue
(5) Notes when the WAR file contains multiple Web Service Implementation Classes or Provider Implementation Classes
(6) Notes for importing and including WSDL definition or XML Schema
(7) Notes on the transport attribute of the SOAP 12:binding element of the WSDL

(1) Conditions for issuing the Meta data

This section describes the respective conditions for issuing POJO and EJB Web Services.

(a) In POJO Web services

The following table lists the conditions for issuing the Meta data for POJO Web services. When the JAX-WS engine on the Web Service receives an HTTP request that fulfills all the conditions described in the following table, the Meta data is issued:

Table 10-10 HTTP request required for issuing the Meta data for POJO Web services

No. Items Conditions
1 HTTP method GET method
2 URL Schema http or https
3 Host name (: port number) Host name (and port number) where the Web Service requesting the issuing of the Meta data exists
4 Context path Context path of the Web application that contains the Web Service that requests the issuing of the Meta data
5 Web Service name Web Service that requests the issuing of the Meta data (service name of the Web Service Implementation Class or the Provider Implementation Class)
6 Query string wsdl or WSDL
(The characters are case sensitive)

The WSDL file associated with the Web Service corresponding to the requested URL is issued in the request source as HTTP response contents. The following query strings must be added in the request URL:

GET http://sample.com:8085/fromjava/AddNumbersImplService?wsdl HTTP/1.1

GET http://sample.com:8085/fromjava/AddNumbersImplService?WSDL HTTP/1.1

(b) In EJB Web Services

The following table lists the conditions for issuing the Meta data for EJB Web Services. When the JAX-WS engine on the Web Service receives an HTTP request that satisfies all the conditions described in the following table, the Meta data is issued:

Table 10-11 HTTP request required for issuing the Meta data for EJB Web services

No. Item Condition
1 HTTP method GET method
2 URL Schema http or https
3 Host name (: port number) Host name (and port number) where the Web Service requesting the issuing of the Meta data exists
4 Context path Context path of the Web application that includes the Web Service that requests the issuing of the Meta data
5 Web Service name Web Service that requests the issuing of the Meta data (service name of the Web Service Implementation Class)
6 EJB class name EJB class name of the Web Service that requests the issuing of the Meta data
7 Query string "wsdl" or "WSDL"
(Case sensitive)

The WSDL file associated with the Web Service corresponding to the requested URL is issued in the request source as HTTP response contents. The following query strings must be added in the request URL:

GET http://sample.com:8085/statelessjava/AddNumbersImplService/AddNumbersImpl?wsdl HTTP/1.1

GET http://sample.com:8085/statelessjava/AddNumbersImplService/AddNumbersImpl?WSDL HTTP/1.1

(2) Issued Meta data

The following table describes the correspondence between the request conditions and the issued Meta data:

Table 10-12 Correspondence between the request conditions and the issued Meta data

No. Request conditions Issued Meta data Whether Web Service is applied
POJO EJB#
1 If the wsdlLocation attribute exists in the javax.jws.WebService annotation (for a Web Service Implementation Class) or in the javax.xml.ws.WebServiceProvider annotation (for a Provider Implementation Class) The WSDL file present in the location specified in the wsdlLocation attribute is returned. Y Y
2 If the wsdlLocation attribute is not specified in the javax.jws.WebService annotation (for a Web Service Implementation Class) or in the javax.xml.ws.WebServiceProvider annotation (for a Provider Implementation Class), but if the WSDL file that has the wsdl:service element exists in the WEB-INF/wsdl directory of the deployed WAR file The WSDL file exists in the WEB-INF/wsdl directory of the deployed Web application is returned. Y --
3 If WSDL does not exist in the Web application
(For other than No.1 and No.2)
A new WSDL is generated and returned, if the target is a Web Service Implementation Class.
The Meta data is not issued, if the target is a Provider Implementation Class.
Y Y

The pre-condition forLLegend:
Y: Applied
--: Not applied

Note:
In EJB Web Service, the Meta data is applicable only for Web Service Implementation Class.

The pre-condition for the issue of Meta data is that the Web Service application does not have an error, is deployed normally, and the execution is started.

The precautions related to the issuing of the Meta data are as follows:

With the Provider Implementation Class, basically you do not need a WSDL. Also, the standard specifications do not define the mapping rules for the javax.xml.ws.WebServiceProvider annotation and the WSDL. Therefore, for issuing the Meta data, you must properly include the created WSDL in a WAR file (unlike the Web Service Implementation Class in which the JAX-WS engine automatically generates a WSDL file). Also, if you do not include cosminexus-jaxws.xml in the WAR file, the portName and targetNamespace attributes of the javax.xml.ws.WebServiceProvider annotation will be required. Specify appropriate values according to the definition contents of the WSDL. For cosminexus-jaxws.xml, see the section 10.3 Customization using cosminexus-jaxws.xml.

(3) Updating the WSDL

When the Web Service is deployed, the JAX-WS engine at the Web service machine automatically generates the WSDL file for the Web Service Implementation Class, as and when required. Even when the JAX-WS engine does not automatically generate a WSDL file, the JAX-WS engine returns a WSDL containing the following information based on the WSDL that is included in the WAR file:

(4) Enabling and disabling Meta data issue

You can specify the enabling or disabling for issuing the Meta data in the value of the com.cosminexus.jaxws.security.publish_wsdl property. You can specify in both, POJO and EJB Web Services.

For the com.cosminexus.jaxws.security.publish_wsdl property, see 10.1.2 Settings for the common definition file.

(5) Notes when the WAR file contains multiple Web Service Implementation Classes or Provider Implementation Classes

The Meta data is acquired for each Web Service Implementation Class or Provider Implementation Class. If the WAR file contains multiple Web Service Implementation Classes or Provider Implementation Classes, the wsdl:binding element and the wsdl:port element of the WSDL definition generated and returned anew using the JAX-WS engine on the Web Service are only the wsdl:binding element and the wsdl:port element corresponding to the Web Service Implementation Class or the Provider Implementation Class of the URL specified in the request. The wsdl:binding element and the wsdl:port element corresponding to the other Web Service Implementation Classes or the Provider Implementation Classes that the WAR file contains are not included.

If you want to publish Meta data containing the wsdl:binding element and the wsdl:port element corresponding to all the Web Service Implementation Classes or the Provider Implementation Classes in the WAR file, the Web Service (application) developer must first create appropriate Meta data and then include the data in the WEB-INF/wsdl directory.

(6) Notes for importing and including WSDL definition or XML Schema

When importing or including the WSDL definition or XML Schema, if WSDL definition or XML Schema used for developing a Web Service is included in the WAR file as is, the Meta data might not be issued normally.

To include a file you want to import or include in the WAR file, you must check the path information included in the WSDL definition or XML Schema at the import source or include source and use the following methods to modify the path information appropriately:

(7) Notes on the transport attribute of the SOAP 12:binding element of the WSDL

In the SOAP 1.2 compatible WSDL that is automatically generated and issued, the transport attribute of the soap12:binding element is the following URL by default:

http://www.w3.org/2003/05/soap/bindings/HTTP/

If you want to change the above URL to the following URL, add the definition to the operation definition file.

http://schemas.xmlsoap.org/soap/http

Add the following definition:
com.cosminexus.jaxws.publish_wsdl.soap12binding=WSI_BP20_TRANSPORT