uCosminexus Application Server, Web Service Development Guide
This chapter describes an example of developing a Web Service starting from SEI. Although this section describes a stub-based development example, you can perform dispatch-based or API-based development of Web Services.
The following table describes the configuration of Web Services to be developed:
Table 8-1 Web Service configuration (Starting from SEI)
| Sr.No. | Item | Value | |
|---|---|---|---|
| 1 | Name of the J2EE server to be deployed | jaxwsserver | |
| 2 | Host name and port number of the Web Server | webhost:8085 | |
| 3 | URL of the naming server | corbaname::testserver:900 | |
| 4 | Context root | statelessjava_dynamic_generate | |
| 5 | Style | document/literal/wrapped | |
| 6 | Namespace URI | http://sample.com | |
| 7 | Port type | Count | 1 |
| 8 | Local name | AddNumbersImpl | |
| 9 | Operation | Count | 1 |
| 10 | Local name | add | |
| 11 | Service | Count | 1 |
| 12 | Local name | AddNumbersImplService | |
| 13 | Port | Count | 1 |
| 14 | Local name | AddNumbersImplPort | |
| 15 | Web Service Implementation Class | com.sample.AddNumbersImpl | |
| 16 | Method that is to be made public in the Web Service Implementation Class | Count | 1 |
| 17 | Method name | add | |
| 18 | Exceptions thrown in the methods used in Web Service implementation | Count | 1 |
| 19 | Class name | com.sample.AddNumbersFault | |
The following table describes the configuration of the current directory used in the Web Service development.
Table 8-2 Configuration of the current directory (Starting from SEI)
| Directory | Description | ||||
|---|---|---|---|---|---|
| c:\temp\jaxws\works\statelessjava | This is the current directory. | ||||
| server\ | This is used in the Web Service development. | ||||
| META-INF\ | Corresponds to the META-INF directory of the EAR file. | ||||
| application.xml | Created in 8.3.3 Creating application.xml | ||||
| src\ | Stores the source files (*.java) of the Web Service. Used in 8.3.1 Creating Web Services Implementation Class and 8.3.2 Compiling Web Services Implementation Class. |
||||
| jar\ | Stores the compiled class files (*.class). Used in 8.3.1 Creating Web Services Implementation Class and 8.3.2 Compiling Web Services Implementation Class. | ||||
| WEB-INF\ | Corresponds to the WEB-INF directory of the EJB JAR files. | ||||
| wsdl\ | Created in 8.3.4 Creating a WSDL file (optional). | ||||
| statelessjava_dynamic_generate.ear | Created in 8.3.5 Creating EAR files. | ||||
| statelessjava_dynamic_generate.war |
|||||
| client\ | This is used in the Web Service client development. | ||||
| src\ | Stores the source files (*.java) of the Web Service client. Used in 8.5.1 Generating a service class and 8.5.2 Creating an Implementation Class for the Web Service client. | ||||
| classes\ | Stores the compiled class files (*.class). Used in 8.5.3 Compiling the Implementation Class for the Web Service client. | ||||
| usrconf.cfg | Created in 8.6.1 Creating an option definition file for Java applications. | ||||
| usrconf.properties | Created in 8.6.2 Creating a user property file for Java applications. | ||||
Change the current directory path according to the development environment.
Note that the description below uses the directory and files names mentioned in the above table. The values in bold used in the command execution examples or Java source are the values that are specified or generated in the examples used within this document. Use appropriate values according to the environment to be built.
Furthermore, in the development example described in this chapter, the Web Service and Web Service client are developed in the same environment; however, they can be developed in different environments. To develop the Web Service and Web Service client in separate environments, you must change the current directory path according to the respective environment.
All Rights Reserved. Copyright (C) 2013, Hitachi, Ltd.