Developing a Web service from an enterprise bean

 

Developing a Web service from an enterprise bean

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

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

This task is one of four ways that you can develop a Web service. You can also develop a Web service from a Java 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, you need develop a new WSDL file.

Enabling the enterprise bean for Web services includes developing the service endpoint interface, locating or developing a WSDL file that is the engine of the Web service, generating and configuring the deployment descriptors, completing the EJB implementation, assembling all the artifacts required for the Web service, enabling the modules and deploying the application into the WebSphere Application Server environment.

To use an enterprise bean as the basis for a Web service implementation, follow these requirements:

These requirements are documented in the JAX-RPC specification available through Web services: Resources for learning.

Create the artifacts that enable the enterprise bean to be a Web service and assemble the artifacts into the enterprise application:

  1. Access an existing Java archive (JAR) file to use as a Web service. Make sure that the enterprise bean meets the requirements.

  2. Develop an Enterprise JavaBeans (EJB) service endpoint interface. The service endpoint interface defines which enterprise bean methods should be made available as a Web service.

  3. Develop a Web Services Description Language (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 from an EJB implementation. You need to complete this step to create the deployment descriptor templates that are configured to map the service implementation to the EJB implementation.

  5. Complete the EJB implementation.

  6. Configure the webservices.xml deployment descriptor. Configure the webservices.xml deployment descriptor so that WebSphere Application Server 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 WebSphere Application Server can process the incoming Web services requests.

  8. Assemble a JAR file that is enabled for Web services from an enterprise bean. This article explains how to assemble the artifacts required to enable the EJB module for Web services into the JAR file.

  9. Assemble a Web services-enabled enterprise bean JAR file into an enterprise archive (EAR) file. This topic explains how to assemble the artifacts required for Web services into to the EAR file.

  10. Enable the EAR file. When the EAR file contains EJB modules, it must have the Web services endpoint Web archive (WAR) file added with the endptEnabler tool before it is deployed.

  11. Deploy the EAR file into WebSphere Application Server.

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

ResultYou have a Web service developed from a stateless session enterprise bean.

 

What to do next

Publish the WSDL file.


Sub-topics
Developing a service endpoint interface from an EJB
Developing Web services deployment descriptor templates for an EJB implementation
Completing the EJB implementation

Related tasks
Developing a WSDL file
Assembling a JAR file that is enabled for Web services from an enterprise bean
Assembling an enterprise bean JAR file into an EAR file
Enabling an EAR file for Web services
Deploying Web services
Developing new Web services from an existing WSDL file using an EJB implementation

Related reference
Artifacts used to develop Web services
Web services: Resources for learning