WAS v8.5 > End-to-end paths > Web servicesImplement web services applications from existing WSDL files with JAX-RPC
We can develop a web service with an existing WSDL file using JAX-RPC.
Best practice: IBM WebSphere Application Server 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. best-practices
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 email, downloading or a URL. To develop web services based on JAX-RPC, we can use a bottom-up development approach starting from existing JavaBeans or 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 JavaBeans or enterprise bean and artifacts that enable the bean as web services and assemble all artifacts 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 JMS transport.
Best practice: It is a best practice to use EJB 2.1style enterprise beans with JAX-RPC applications..
- Set up a development environment for web services. We 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 configured to map the service implementation to the JavaBeans or enterprise beans implementation.
- Complete the implementation of the 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 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 the application server can process the incoming web services requests.
- Assemble the artifacts for the web service.
Use assembly tools provided with the application server to assemble your Java-based web services modules.
If we have assembled an EAR filecontaining enterprise beans modules containing 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 by starting with an existing WSDL file.
After deploying the EAR file, test the web service to verify it works with the application server.
Subtopics
- Develop JAX-RPC web services with WSDL files (top-down)
- Assemble web services applications
We can assemble Java-based web services applications using assembly tools.- Deploy web services applications onto application servers
After assembling the artifacts required to enable the web module for web services into an EAR file, we can deploy the EAR file into the application server.- Use a third-party JAX-WS web services engine
In certain situations we might need to set up a third-party JAX-WS web services engine. For example, set up a third-party JAX-WS web services engine if you need to deploy applications that use a single runtime across various application servers such as WAS, JBoss, and WebLogic, or to build JAX-WS web services applications using third party JAX-WS run-times such as CXF, Axis2, and Metro.
Related concepts:
JAX-RPC
Web services
Related
Set up a development environment for web services
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
Completing the JavaBeans implementation for JAX-RPC applications
Completing the EJB implementation for JAX-RPC applications
Configure the webservices.xml deployment descriptor for JAX-RPC web services
Configure the ibm-webservices-bnd.xmi deployment descriptor for JAX-RPC web services
Assemble web services applications
Assemble a WAR file that is enabled for web services from Java code
Assemble a web services-enabled WAR into an EAR file
Deploy web services applications onto application servers
Testing web services-enabled clients
Use HTTP to transport web services
Use SOAP over JMS to transport web services
Reference:
Artifacts used to develop web services
Web services specifications and APIs