Network Deployment (Distributed operating systems), v8.0 > End-to-end paths > Web services
Implementing web services applications from existing WSDL files with JAX-WS
When starting with an existing WSDL file, you can use a top-down approach to developing web services based on JAX-WS.
Best practice: 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
Locate the WSDL file that defines the web service to implement. We can develop a WSDL file or obtain one from an existing web service through email, downloading or a Uniform Resource Locator (URL). JAX-WS
To develop web services based on JAX-WS, 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 top-down development approach.
Considerations when using JavaBeans
- JavaBeans exposed as JAX-WS web services are supported only over an HTTP transport.
- JavaBeans may use Contexts and Dependency Injection (CDI). Note that constructor injection is not supported.
Considerations when using enterprise beans
- The enterprise bean must be a stateless or singleton session bean.
- Enterprise beans that are exposed as JAX-WS web services must be packaged in EJB 3.0 or higher modules.
- JAX-WS web service applications containing enterprise beans must be deployed with the endptEnabler command.
- JAX-WS web services using enterprise beans are supported over an HTTP or JMS transport.
- Enterprise beans may use CDI. Note that constructor injection is not supported.
Procedure
- Set up a development environment for web services.
- Develop Java artifacts for JAX-WS applications using the wsimport command-line tool.
- (optional) Enable MTOM for JAX-WS web services.
- (optional) Enforce adherence to WSDL bindings in JAX-WS web services.
- (optional) Develop and configure a webservices.xml deployment descriptor for JAX-WS applications.
- Complete the implementation of your web service application.
- (Optional) Customize URL patterns in the web.xml file.
- Assemble the artifacts for your web service.
- Deploy the EAR file into the application server.
- Test the web service to make sure that the service works with the application server.
Results
You have created a JAX-WS web service by starting with an existing WSDL file.