uCosminexus Application Server, Web Service Development Guide

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

4.5.1 Generating a service class

If you execute the cjwsimport command, the Java source, such as a service class, required for Web Service client development is generated. For the cjwsimport command, see 14.1 cjwsimport command.

The following is an execution example when developing Web Service clients in the same environment in which the Web Service is developed:

> cd c:\temp\jaxws\works\fromwsdl\client\
> mkdir src/
> mkdir classes/
> "%COSMINEXUS_HOME%\jaxws\bin\cjwsimport.bat" -s src -d classes ..\server\WEB-INF\wsdl\input.wsdl

The following is an execution example when developing Web Service clients on an environment different from the environment in which the Web Service is developed:

> cd c:\temp\jaxws\works\fromwsdl\client\
> mkdir src/
> mkdir classes/
> "%COSMINEXUS_HOME%\jaxws\bin\cjwsimport.bat" -s src -d classes http://webhost:8085/fromwsdl/TestJaxWsService?wsdl

When the execution is successful, the Java source will be generated in c:\temp\jaxws\works\fromwsdl\client\src\com\example\sample\directory. The directory path com\example\sample\(directory-path-corresponding-to-the-package) changes as per the coding of the namespace URI. For the mapping between namespace URIs and packages, see 15.1.1 Mapping a namespace to a package name.

The following table lists and describes the products:

Table 4-4 Products during service class generation (Starting from WSDL)

File name Description
JaxWsTest1.java This is a JavaBean class corresponding to 'Type referenced by the wrapper element of the request message' in the WSDL definition.
JaxWsTest1Response.java This is a JavaBean class corresponding to 'Type referenced by the wrapper element of the response message' in the WSDL definition.
ObjectFactory.java This is the ObjectFactory class of the JAXB 2.2 specifications.
package-info.java This is the package-info.java file.
TestJaxWs.java This is an SEI corresponding to the TestJaxWsPort type.
TestJaxWsService.java This is the service class.
UserDefinedFault.java This is a JavaBean class corresponding to 'Type referenced by the wrapper element of the fault message' in the WSDL definition.
UserDefinedException.java This is the wrapper exception class of the fault bean.

The file names JaxWsTest1, TestJaxWs, and TestJaxWsService change according to the coding of the local name for operation, local name for port type, and local name for services. For the mapping between a local name for operation, local name for port type, and local name for services and Java sources, see the following sections: