WAS v8.5 > End-to-end paths > Web servicesImplement web services applications from existing WSDL files with JAX-WS
When starting with an existing WSDL file, we can use a top-down approach to developing web services based on JAX-WS.
IBM WebSphere Application Server supports JAX-WS and the (JAX-RPC) programming model. JAX-WS extends JAX-RPC with support for annotations.
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 URL.
To develop web services based on JAX-WS, 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.
- 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
We do not have to set up a development environment if you are using Rational Application Developer.
- Develop Java artifacts for JAX-WS applications using the wsimport command-line tool.
The wsimport tool processes a WSDL file and generates portable Java artifacts used to create a web service.
- Generate Java artifacts for JAX-WS applications from a WSDL file
- (optional) Enable MTOM for JAX-WS web services
We can use SOAP Message Transmission Optimization Mechanism to optimize the transmission of binary attachments such as images or files along with web services requests.
- (optional) Enforce adherence to WSDL bindings in JAX-WS web services
We can use the RespectBindingFeature to control whether a JAX-WS implementation is required to respect the contents of a wsdl:binding associated with an endpoint.
- (optional) Develop and configure a webservices.xml deployment descriptor for JAX-WS applications
We can optionally use the webservices.xml deployment descriptor to augment or override application metadata specified in annotations within your JAX-WS web services.
- Complete the implementation of the web service application.
- For JavaBeans applications, complete the JavaBeans implementation.
- For enterprise beans applications, complete the enterprise beans implementation.
- (Optional) Customize URL patterns in the web.xml file
When JavaBeans are exposed as JAX-WS endpoints, we can optionally customize the URL patterns within the web.xml deployment descriptor contained in the WAR file.
- Assemble the artifacts for the web service
- Deploy the EAR file into the application server.
We can now deploy the EAR file that has been configured and enabled for web services onto the application server.
- Test the web service to verify the service works with the application server
Related
JAX-WS
Set up a development environment for web services
Generate Java artifacts for JAX-WS applications from a WSDL file
Enable MTOM for JAX-WS web services
Enforcing adherence to WSDL bindings in JAX-WS web services
Develop a webservices.xml deployment descriptor for JAX-WS applications
Completing the JavaBeans implementation for JAX-WS applications
Completing the EJB implementation for JAX-WS applications
Customize URL patterns in the web.xml file for JAX-WS applications
Assemble web services applications
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
Example: Installing a web services sample with the console
Implement web services applications with JAX-WS
Artifacts used to develop web services
Web services specifications and APIs
CDI
JAX-WS API documentation
JAX-WS API User's Guide documentation