Develop a Web service from a Java bean

This task explains how to develop a Web service from a Java bean.

 

Before you begin

Set up a Web services development and unmanaged client run-time environment.

 

Overview

This task is one of four ways that one can develop a Web service. We can also develop a Web service from an enterprise bean, develop a Web service with an existing Web Services Description Language (WSDL) file using a Java bean, or develop a Web service with an existing WSDL file using an enterprise bean. In this task, we need develop a new WSDL file.

You can use a Java bean that already exists and then enable the implementation for Web services. Enabling the Java bean for Web services includes developing the service endpoint interface, developing a WSDL file that is the engine of the Web service, generating and configuring the deployment descriptors, assembling all artifacts required for the Web service, and deploying the application into the WAS environment.

Develop a Web service from a Java bean by following the task steps provided in this section.

 

Procedure

  1. Access an existing Java bean WAR file.

  2. Develop a Java bean service endpoint interface. The service endpoint interface defines the methods for a particular Web service. The Java bean must implement methods having the same signature as the methods on the service endpoint interface.

  3. Develop a WSDL file. The WSDL file is the engine of a Java 2 Platform, Enterprise Edition (J2EE) Web service; without it there is no Web service.

  4. Develop Web services deployment descriptor templates for a JavaBeans implementation. You need to complete this step to create the deployment descriptor templates that are configured to map the service implementation to the JavaBeans implementation.

  5. Complete the JavaBeans implementation. When you complete the JavaBeans implementation, you are assembling a JAR file that contains a JavaBeans implementation and supported classes created from the WSDL file.

  6. Configure the webservices.xml deployment descriptor. Configure the webservices.xml deployment descriptor so that WAS can process the incoming Web services requests.

  7. Configure the ibm-webservices-bnd.xmi deployment descriptor. Configure the ibm-webservices-bnd.xml deployment descriptor so that WAS can process the incoming Web services requests.

  8. Assemble a WAR file that is enabled for Web services from Java code. This article explains how to assemble the artifacts required to enable the Web module for Web services are added to the WAR file.

  9. Assemble a WAR file that is enabled for Web services into an EAR file. This topic explains how to assemble the artifacts required to enable the Web module for Web services that are added to the EAR file.

  10. Deploy the EAR file into WebSphere Application Server.

    This topic presents the steps necessary to deploy the EAR file that has been configured and enabled for Web services.

 

Result

You have a Web service developed from a Java bean.

 

What to do next

After you deploy the EAR file, test the Web service to make sure that it works with WebSphere Application Server.

 

See also


Developing a service endpoint interface for a JavaBeans implementation
Developing a WSDL file
Developing Web services deployment descriptor templates for a JavaBeans implementation
Completing the JavaBeans implementation

 

See Also


Web services

 

Related Tasks


Assembling Web services applications
Assembling a WAR file that is enabled for Web services from Java code
Assembling a Web services-enabled WAR into an EAR file
Deploying Web services
Developing a new Web service with an existing WSDL file using JavaBeans technology
Setting up a development and unmanaged client run-time environment for Web services

 

See Also


Artifacts used to develop Web services