Development of the above Web service application proceeds as follows:
Create the project for the Web service
In order to create the Web service application, first create a dynamic Web application project. When the dynamic Web application project is created as directed by the wizard, the classpath and other settings required for the build are set automatically.
Create the Web service
Use the following procedure to create the Web service:
Create the data class
Create the data class to be used to implement the Web service.
Create the Web service pattern
Use the wizard to create the Java class.
Declare the WebService annotation
Declare the annotation in the Java class created by the wizard.
Implement the Web service
Declare the method in the class that declared the annotation to implement processing.
Create the EAR project
Create a project for creating an EAR file for distribution as one application including the EJB client. When creating the EAR project, specify to include the created dynamic Web project in the EAR file. Since the client is not yet created, specify to include the client in the EAR file when creating the client project.
Prepare to fetch the WSDL
Use the following procedure to prepare to fetch the WSDL required for client creation:
Set the relation between the EAR project and the server
Set the relation with the server to enable deployment to the server so that the WSDL will be able to be fetched.
Deploy to the server
Actually deploy to the server to make it possible to fetch the WSDL from the server.
Check the URL of the WSDL
Check the URL to be used to fetch the WSDL.
Create the Web service client
Use the following procedure to create the Web application that will be the client:
Create the client project
Create a dynamic Web project for creating a Web application as a client.
Create the Service Endpoint Interface from the WSDL
Use the wizard to create from the WSDL the Service Endpoint Interface and other required files.
Create the servlet class
Use the wizard to create a servlet as a controller for receiving Web application requests.
Create the I/O page
Use the wizard to create the Web application I/O page.
Specify the Dependency Injection
Set the Dependency Injection in the field such that the Web service method is invoked from the servlet.
Implement the Web service invocation processing
Implement the processing for invoking the Web service method using the field that declared the Dependency Injection.
Check the operation of the application
Use the following procedure to check the application operation:
Set the relation between the project and a server
Set which server the application is deployed on. Since the settings are already completed in order to fetch the WSDL, nothing need be done here.
Set the breakpoints
Set the breakpoints for the debugger to check the program operation during execution.
Launch the server
Launch the server so that it can receive requests in relation to the application from Web browsers. Deployment is performed automatically before the server starts.
Execute the application
Launch the Web browser and access the application URL to start checking the operation of the application.
Debug the application
Debug the program and check that the application is operating correctly.
Distribute the application to the operating environment
Use the following procedures to distribute the application to the operating environment:
Export the application
Create an EAR file to distribute the application to the operating environment.
Distribute to the operating environment
Deploy the EAR file from the Interstage Java EE Admin Console.