uCosminexus Service Platform, Basic Development Guide

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

8.3.3 Creating service classes

Create a service class from the acquired WSDL. Create a service class with the cjwsimport command provided by the JAX-WS functionality.

A command input example is shown below:

 
cjwsimport -s source-file-output-destination-directory -d compiled-class-file-output-destination-directory cscmsg_ws_doc.wsdl
 

For the JAX-WS engine, set up cscmsg_ws_doc.wsdl in such a way so that the WSDL style becomes document-literal.

In the input example of this command, the WSDL (cscmsg_ws_doc.wsdl) acquired in 8.3.2 Acquiring WSDL is saved in the current directory in which the cjwsimport command is executed.

For details about options of the cjwsimport command, see the manual Cosminexus Application Server Web Service Development Guide.

When you execute this command, the following directories and files will be created in the output destination directory of the specified source file:

 
/Output destination directory of the source file
 jp/co/hitachi/soft/csc/msg/message/reception/ejb/
 CSCMsgServerFaultException.java
    //Class in which fault information unique to HCSC server is saved
 CSCMsgServerFaultException_Exception.java
    //Exception class that throws CSCMsgServerFaultException
 CSCMsgSyncServiceDeliveryWSImpl.java
    //Service end point interface corresponding to the portType element of the WSDL
 CSCMsgSyncServiceDeliveryWSImplService.java
    //Service class
 GetServiceInfo.java
    //JavaBean class for the request message of the getServiceInfo operation#1
 GetServiceInfoResponse.java
    //JavaBean class for the response message of the getServiceInfo operation#1
 InvokeBinary.java
    //JavaBean class for the request message of the invokeBinary operation#1
 InvokeBinaryResponse.java
    //JavaBean class for the response message of the invokeBinary operation#1
 InvokeBPXML.java
    //JavaBean class for the request message of the invokeBPXML operation#1
 InvokeBPXMLResponse.java
    //JavaBean class for the response message of the invokeBPXML operation#1
 InvokeXML.java
    //JavaBean class for the request message of the invokeXML operation#1
 InvokeXMLResponse.java
    //JavaBean class for the response message of the invokeXML operation#1
 ObjectFactory.java
    //ObjectFactory class of the JAXB2.1 specifications
 package-info.java
      //Files used with JAXB2.1
 cscmsg_ws_doc.wsdl#2
 

#1
Used in JAXB2.1.

#2
In this output example, the cjwsimport command is executed in the following conditions:
  • The WSDL (cscmsg_ws_doc.wsdl) acquired in 8.3.2 Acquiring WSDL is saved in the directory specified in the -s option of the cjwsimport command. The WSDL specified in the cjwsimport command is also a WSDL that exists in the directory specified in the -s option.
  • The cjwsimport command is executed by omitting the -s option, and the WSDL (cscmsg_ws_doc.wsdl) acquired in 8.3.2 Acquiring WSDL is saved in the current directory in which the cjwsimport command is executed. The WSDL specified in the cjwsimport command is also a WSDL for which no directory is specified and that exists in the current directory.
The WSDL (cscmsg_ws_doc.wsdl) specified in the cjwsimport command is not output in the output destination directory of the source file specified in the -s option after the command is executed.
Note
For a service requester supporting the JAX-WS engine for communication, the WSDL is read during the execution of the program. When the default constructor of the service class is used, the WSDL in the WSDL path (directory that stores the WSDL file acquired in 8.3.2 Acquiring WSDL for generating the service class) is read. Therefore, after executing the cjwsimport command, do not move the WSDL file so that the configuration position of the WSDL file based on the service class does not obstruct the relative relationship. For changing the configuration position of the WSDL referenced during the execution of the service requester from the WSDL path specified with the cjwsimport command, use a constructor for which the URL can be specified.