Develop Web services applications from enterprise beans
Overview
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 WSDL file using a Java bean
- develop a Web service with an existing WSDL file using an enterprise bean
In this task, we 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 enterprise beans 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:
- The enterprise bean must be a stateless session bean.
- Web service method parameters must be one of the supported Java API for XML-based remote procedure call (JAX-RPC) types.
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.
Procedure
- Set up a development environment for Web services. You do not have to set up a development environment if you are using Rational Application Developer.
- Access an existing Java archive (JAR) file to use as a Web service. Verify the enterprise bean meets the requirements.
- Develop an Enterprise JavaBeans service endpoint interface. The service endpoint interface defines which enterprise bean methods should be made available as a Web service.
- Develop a Web Services Description Language (WSDL) file. The WSDL file is the engine of a J2EE Web service; without it there is no Web service.
- Develop Web services deployment descriptor templates from an Enterprise JavaBeans implementation. We need to complete this step to create the deployment descriptor templates that are configured to map the service implementation to the enterprise beans implementation.
- Complete the enterprise beans implementation.
- Configure the webservices.xml deployment descriptor. Configure the webservices.xml deployment descriptor so that WAS can process the incoming Web services requests.
- 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.
- Assemble a JAR file that is enabled for Web services from an enterprise bean. You can assemble the artifacts that are required to enable the enterprise beans module for Web services into a JAR file.
- Assemble a Web services-enabled enterprise bean JAR file into an enterprise archive (EAR) file. You can assemble the artifacts that are required to enable the Web services-enabled JAR file into an EAR file.
- Enable the EAR file. When the EAR file contains enterprise bean modules, it must have the Web services endpoint WAR file added with the endptEnabler tool before it is deployed.
- Deploy the EAR file into WAS.
This topic presents the steps necessary to deploy the EAR file that has been configured, assembled and enabled for Web services.
Results
You have a Web service developed from a stateless session enterprise bean.
What to do next
Publish the WSDL file.
Developing a service endpoint interface from an EJB
Developing Web services deployment descriptor templates for an EJB implementation
Completing the EJB implementation
Use the JMS API to transport JAX-RPC Web services requests
Use WSDL EJB bindings to invoke an EJB from a Web services client
Related tasks
Developing a WSDL file for JAX-RPC applications
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 applications onto appservers
Developing Web services applications from existing WSDL files with enterprise beans
Related Reference
Artifacts used to develop Web services
Web services specifications and APIs
Web services: Resources for learning