uCosminexus Application Server, Web Service Development Guide

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

35.5.1 Generating a service class

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

The following is an example when the Web Service client is developed in the same environment as the Web Service:

> cd c:\temp\jaxws\works\wsrm\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 example when the Web Service client is developed in an environment other than the Web Service:

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

On successful termination of the cjwsimport command, the Java sources are generated in the c:\temp\jaxws\works\wsrm\client\src\com\example\sample\ directory. Note that the directory path com\example\sample\ (the directory path corresponding to the package) changes according to the coding of the namespace URI. For the mapping between Namespace URI and package, see 15.1.1 Mapping a names pace to a package name.

The following table lists the generated products:

Table 35-4 Products created when the service class is generated (Starting from WSDL)

File name Explanation
JaxWsTest1.java This is a JavaBean class corresponding to the 'type referenced by the wrapper element of the request message' in the WSDL definition.
JaxWsTest1Response.java This is a JavaBean class corresponding to the 'type referenced by the wrapper element of the response message' in the WSDL definition.
ObjectFactory.java This is an ObjectFactory class of the JAXB 2.2 specifications.
package-info.java This is a package-info.java file.
TestJaxWs.java This is the SEI corresponding to the TestJaxWsPort type.
TestJaxWsService.java This is a service class.
UserDefinedFault.java This is a JavaBean class corresponding to the '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 the operation, the local name for the port type, and the local name for the services. For the mapping between the local name for the operation, the local name for the port type, and the local name for the services and Java sources, see the following sections: