+

Search Tips   |   Advanced Search

Implement Web services applications from existing WSDL files with JAX-RPC


We can develop a Web service with an existing WSDL file using the JAX-RPC model.

Best practice: IBM WAS supports the JAX-WS model and the JAX-RPC model. JAX-WS is the next generation Web services model extending the foundation provided by the JAX-RPC model. Using the strategic JAX-WS model, development of Web services and clients is simplified through support of a standards-based annotations model. Although the JAX-RPC model and applications are still supported, take advantage of the easy-to-implement JAX-WS model to develop new Web services applications and clients. bprac

Locate the WSDL file that defines the Web service to implement. We can develop a WSDL or obtain one from an existing Web service through e-mail, downloading or a URL.

To develop Web services based on the JAX-RPC programming model, we can use a bottom-up development approach starting from existing Java Beansor enterprise beans or we can use a top-down development approach starting with an existing 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 Java Beans 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 appserver.

Considerations when using Java Beans

Java Beans 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.

Best practice: It is a best practice to use EJB 2.1 style enterprise beans with JAX-RPC applications. bprac

 

  1. Set up a development environment for Web services. You do not have to set up a development environment if we are using Rational Application Developer.

  2. Develop the Java artifacts from a WSDL file. we need to create the deployment descriptor templates and bindings that are configured to map the service implementation to the Java Beans or enterprise beans implementation.

  3. Complete the implementation of the Web service application.

  4. Set the webservices.xml deployment descriptor. For JAX-RPC Web services, configure the webservices.xml deployment descriptor so that the appserver can process the incoming Web services requests.
  5. Set the ibm-webservices-bnd.xmi deployment descriptor. Set the ibm-webservices-bnd.xml deployment descriptor so that the appserver can process the incoming Web services requests.
  6. Assemble the artifacts for the Web service.

    Use assembly tools provided with the appserver to assemble the Java -based Web services modules.

    If we 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 JMS or SOAP over HTTP.

  7. Deploy the EAR file into the appserver. We can now deploy the EAR file that has been configured and enabled for JAX-RPC Web services onto the appserver.

 

Results

we have developed a JAX-RPC Web service application by starting with an existing WSDL file.

 

Next steps

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


Develop Java artifacts for JAX-RPC applications from a WSDL file
Develop EJB implementation templates and bindings from a WSDL file for JAX-RPC Web services

 

Related concepts


JAX-RPC
Web services

 

Related tasks


Set up a development environment for Web services
Completing the Java Beans implementation for JAX-RPC applications
Completing the EJB implementation for JAX-RPC applications
Set the webservices.xml deployment descriptor for JAX-RPC Web services
Set the ibm-webservices-bnd.xmi deployment descriptor for JAX-RPC Web services
Assemble 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 appservers
Use HTTP to transport Web services
Use SOAP over Java Message Service to transport Web services

 

Related


Artifacts used to develop Web services
Example: Deploying a JAX-RPC Web service from an existing application
Web services specifications and APIs