uCosminexus Application Server, Application Development Guide

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

8.4.3 Developing Web service client using EJB

This subsection describes how to develop a Web Service client using EJB.

Organization of this subsection
(1) Flow of Web Service client development using EJB
(2) Creating an EJB project
(3) Acquiring a WSDL file
(4) Generating a Java source
(5) Implementing a Web Service client
(6) Editing ejb-jar.xml
(7) Creating enterprise application projects and adding modules
(8) Deploying and debugging J2EE applications

(1) Flow of Web Service client development using EJB

The following figure shows the flow of Web Service client development using EJB:

Figure 8-5 Flow of Web Service client development using EJB

[Figure]

An overview of the individual operations is as follows:

  1. Creating an EJB project
    Create an EJB project to be used for developing a Web Service client. For details, see 8.4.3(2) Creating an EJB project.
  2. Acquiring a WSDL file
    Acquire a WSDL file or acquire the URL of a released WSDL file. For details, see 8.4.3(3) Acquiring a WSDL file.
  3. Generating a Java source
    Generate the Java source for implementing the Web Service client. For details, see 8.4.3(4) Generating a Java source.
  4. Implementing a Web Service client
    Use the generated Java source to implement the Web Service client. For details, see 8.4.3(5) Implementing a Web Service client.
  5. Editing ejb-jar.xml
    Add the EJB definition implementing the Web Service client. For details, see 8.4.3(6) Editing ejb-jar.xml.
  6. Creating an enterprise application project and adding a module
    Create an enterprise application project and add the EJB project. For details, see 8.4.3(7) Creating enterprise application projects and adding modules.
  7. Deploying and debugging J2EE applications
    You deploy and then debug J2EE applications in the J2EE server. For details, see 8.4.3(8) Deploying and debugging J2EE applications.

The following subsections describe the development of a Web Service client using EJB according to the above flow.

(2) Creating an EJB project

Create an EJB project to be used for developing a Web Service client using EJB. For details on how to create the EJB projects, see the subsection 4.4.2 Creating an EJB project.

(3) Acquiring a WSDL file

Acquire the WSDL file that describes the meta information of Web Services that you are trying to invoke, or if the URL of the WSDL file has been released, acquire that URL.

(4) Generating a Java source

Based on the acquired WSDL file, generate the Java source (service class, SEI, and Java Bean (stub)) required for developing and executing the Web Service client. You can generate the Java source using Eclipse. The procedure of generating the Java source is same as described in the subsection 8.4.1(4) Generating a Java source, however in Project in the Web Service Client dialog box, select the EJB project name of the workspace.

When the following operations or settings are performed and the Web Service Client dialog box appears, the Java source folder column becomes blank and the subsequent operations can no longer be performed. Therefore, specify a folder other than the project root in Java source folder.

(5) Implementing a Web Service client

Use the generated Java source to implement the Web Service client. For the examples of implementing a Web Service client, see 3.6 Implementing a Web Service client in the manual uCosminexus Application Server Web Service Development Guide.

(6) Editing ejb-jar.xml

In ejb-jar.xml, add the definition of EJB that implements the Web Service client.

(7) Creating enterprise application projects and adding modules

(a) Creating enterprise application projects

Create the enterprise application projects. For details on how to create the enterprise application projects, see the subsection 4.4.4 Creating an enterprise application project.

(b) Adding modules in enterprise application projects

In the enterprise application project, add the EJB project for the Web Service client created in 8.4.3(2) Creating an EJB project. To add an EJB project:

  1. On the EAR Application Project page of the New EAR Application Project dialog box, click the Next button.
    The Enterprise Application page appears.
  2. Select the module to be added, and then click the Finish button.

(8) Deploying and debugging J2EE applications

Deploy and debug the created projects.

(a) Deploying J2EE applications

Deploy the J2EE applications that are created from the enterprise application project on the J2EE server. For details on how to deploy the J2EE applications, see the subsection 6.7 Releasing a project on a J2EE server.

(b) Debugging J2EE applications

Debug the created J2EE applications. For details on how to debug the J2EE applications, see the subsection 6.8 Debugging and executing J2EE applications.