uCosminexus Application Server, Web Service Development Guide
With the development examples described in this chapter, use SAAJ for developing Web Services that send and receive SOAP Messages, with a dispatch or a provider.
Note that this section describes an example in which the information about an employee number and an employee face photographs is sent from a Web Service client. A Web Service registers the received information, and returns a registration confirmation message. The Java data type of the employee number and the registration confirmation message is java.lang.String, and the Java data type of the face photograph is javax.activation.DataHandler.
The following table describes the configuration of Web Services to be developed:
Table 9-1 Web Service configuration (Starting from a provider and SAAJ)
| Item 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 | dispatch_provider | |
| 5 | Namespace URI | http://sample.com | |
| 6 | Service | Number | 1 |
| 7 | Local name | UserInfoService | |
| 8 | Port | Number | 1 |
| 9 | Local name | UserInfoPort | |
The following table describes the configuration of the current directory for developing Web Services:
Table 9-2 Configuration of the current directory (Starting from a provider and SAAJ)
| Directory | Description | |||
|---|---|---|---|---|
| c:\temp\jaxws\works\dispatch_provider | This is the current directory. | |||
| server\ | Used for developing a Web Service. | |||
| META-INF\ | Corresponds to the META-INF directory of EAR files. | |||
| application.xml | Created in 9.3.4 Creating application.xml. | |||
| src\ | Saves the source file (*.java) of the Web Service. Used in 9.3.1 Creating Provider Implementation Classes. | |||
| WEB-INF\ | Corresponds to the WEB-INF directory of WAR files. | |||
| web.xml | Created in 9.3.3 Creating web.xml. | |||
| classes\ | Saves the compiled class file (*.class). Used in 9.3.2 Generating Java sources. | |||
| dispatch_provider.ear | Created in 9.3.5 Creating EAR files. | |||
| dispatch_provider.war | ||||
| client\ | Used for developing a Web Service client. | |||
| src\ | Saves the source file (*.java) of the Web Service client.Created in 9.5.1 Creating an implementation class for the Web Service client. | |||
| classes\ | Saves the compiled class file (*.class). Created in 9.5.2 Compiling the Implementation Class for the Web Service client. | |||
| usrconf.cfg | Created in 9.6.1 Creating option definition files for Java applications. | |||
| usrconf.properties | Created in 9.6.2 Creating user property files for Java applications. | |||
Change the current directory path according to the environment to be developed.
Note that the directory and file names listed in the above table will be used in the description hereafter. The parts in the Bold font of the command execution examples and the Java source indicate the specified values and the generated values used in the examples. Substitute the values according to the environment you want to build.
Also, in the development examples described in this chapter, a Web Service and a Web Service client are developed in the same environment. However, you can also develop Web Services and Web Service clients in different environments. For developing Web Services and Web Service clients in different environments, substitute the current directory path corresponding to the respective environments.
All Rights Reserved. Copyright (C) 2013, Hitachi, Ltd.