Network Deployment (Distributed operating systems), v8.0 > End-to-end paths > Web services
Implement web services applications with JAX-RPC
We can use JAX-RPC to develop web services.
IBM WAS supports the JAX-WS programming model and JAX-RPC. JAX-WS is the next generation web services programming model extending the foundation provided by JAX-RPC. Using the strategic JAX-WS programming model, development of web services and clients is simplified through support of a standards-based annotations model. Although JAX-RPC and applications are still supported, take advantage of the easy-to-implement JAX-WS programming model to develop new web services applications and clients. bprac
To develop web services based on JAX-RPC, you can use a bottom-up development approach starting from existing JavaBeans or enterprise beans or you can use a top-down development approach starting with an existing WSDL file. This task describes the steps when using the bottom-up development approach.
When developing a JAX-RPC web service starting from existing JavaBeans or enterprise beans, you need develop a WSDL file. We can use existing JavaBeans or enterprise beans and then enable the implementation for web services. Enabling the bean for web services includes developing the service endpoint interface, developing a WSDL file that is the description of the web service, generating and configuring the deployment descriptors, assembling all artifacts required for the web service, and deploying the application onto the application server.
Considerations when using JavaBeans
JavaBeans exposed as JAX-RPC web services are supported only over an HTTP transport.
Considerations when using enterprise beans
- The enterprise bean must be a stateless session bean.
- Enterprise beans that are exposed as JAX-RPC web services must be packaged in EJB 2.1 or in EJB 3.0 or higher modules.
- For JAX-RPC web services using EJB 2.1 style endpoints, the Web service method parameters must be one of the supported JAX-RPC types. These requirements are documented in the JAX-RPC specification.
- JAX-RPC web services using enterprise beans are supported over an HTTP or JMS transport.
It is a best practice to use EJB 2.1 style enterprise beans with JAX-RPC applications. bprac
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.
- Determine the existing JavaBeans or enterprise beans to expose as a JAX-RPC web service.
- Develop a service endpoint interface. The service endpoint interface defines the JavaBeans or enterprise beans methods for a particular web service. The JavaBeans must implement methods that have the same signature as the methods on the service endpoint interface.
- Develop a service endpoint interface for JavaBeans applications.
- Develop a service endpoint interface for enterprise beans applications.
- Develop the Java artifacts.
- Develop a WSDL file. The WSDL file is the description of a Java EE web service. For JAX-RPC applications, a WSDL file is required.
- Develop JAX-RPC deployment descriptors. Use the WSDL2Java command-line tool to create the deployment descriptor templates that are configured to map the service implementation to the JavaBeans or enterprise beans implementation.
- Develop web services deployment descriptor templates for a JavaBeans implementation.
- Develop web services deployment descriptor templates for an enterprise beans implementation.
- Complete the implementation of your web service application.
- For JavaBeans applications, complete the JavaBeans implementation.
- For enterprise beans applications, complete the enterprise beans implementation.
- Configure the webservices.xml deployment descriptor. For JAX-RPC web services, configure the webservices.xml deployment descriptor so that the application server 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 the application server can process the incoming web services requests.
- Assemble the artifacts for your web service.
Use assembly tools provided with the application server to assemble your Java-based web services modules.
If we have assembled an EAR file that contains enterprise beans modules that contain web services, use the endptEnabler command-line tool or an assembly tool before deployment to produce a web services endpoint WAR file. This tool is also used to specify whether the Web services are exposed using SOAP over JMS or SOAP over HTTP.
- Deploy the EAR file into the application server. We can now deploy the EAR file that has been configured and enabled for JAX-RPC web services onto the application server.
Results
You have developed a JAX-RPC web service application.
What to do next
After you deploy the EAR file, test the web service to make sure that the service works with the application server.
Related
Develop a service endpoint interface from JavaBeans for JAX-RPC applications
Develop a service endpoint interface from enterprise beans for JAX-RPC applications
Develop a WSDL file for JAX-RPC applications
Develop JAX-RPC web services deployment descriptor templates for a JavaBeans implementation
Develop JAX-RPC web services deployment descriptor templates for an enterprise bean implementation
Complete the JavaBeans implementation for JAX-RPC applications
Complete the EJB implementation for JAX-RPC applications
Configure the webservices.xml deployment descriptor for JAX-RPC web services
Configure the webservices.xml deployment descriptor for handler classes
Configure the ibm-webservices-bnd.xmi deployment descriptor for JAX-RPC web services
Use WSDL EJB bindings to invoke an EJB from a JAX-RPC Web services client
JAX-RPC
Web services
Set up a development environment for web services
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
Deploy web services applications onto application servers
Test web services-enabled clients
Use HTTP to transport web services
Use SOAP over JMS to transport web services
Related
Artifacts used to develop web services
Web services specifications and APIs