You can develop a Web service with an existing Web Services
Description Language (WSDL) file using the Java™ API
for XML-based RPC (JAX-RPC) programming model.
Before you begin
Best practice: IBM® WebSphere® Application Server supports the Java API for XML-Based Web Services (JAX-WS)
programming model and the Java API
for XML-based RPC (JAX-RPC) programming model. JAX-WS is the next
generation Web services programming model extending the foundation
provided by the JAX-RPC programming model. Using the strategic JAX-WS
programming model, development of Web services and clients is simplified
through support of a standards-based annotations model. Although
the JAX-RPC programming model 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
Locate
the WSDL file that defines the Web service that you want to implement.
You can develop a WSDL or obtain one from an existing Web service
through e-mail, downloading or a Uniform Resource Locator (URL).
About this task
To develop Web services based on the JAX-RPC programming
model, 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
Web Services Description Language (WSDL) file. This task describes
the steps when using the top-down development approach.
When
developing a JAX-RPC Web service starting from an existing WSDL file,
create the JavaBeans or enterprise bean
and artifacts that enable the bean as Web services and assemble all
artifacts that are required for the Web service, and deploy 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 Java Message Service (JMS) transport.
Best practice: 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.
- Develop the Java artifacts
from a WSDL file. You need to create the deployment descriptor
templates and bindings that are configured to map the service implementation
to the JavaBeans or enterprise beans implementation.
- Complete the implementation of your Web service application.
- 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 you have assembled an Enterprise Archive
(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 Java Message
Service (JMS) or SOAP over HTTP.
- Deploy the
EAR file into the application server. You 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 by
starting with an existing WSDL file.
What to do next
After you deploy the EAR file, test the Web service to make sure that it works
with the application server.