WebSphere Application Server Version 6.1 Feature Pack for Web Services
             Operating Systems: AIX, HP-UX, i5/OS, Linux, Solaris, Windows, z/OS

             Personalize the table of contents and search results
             New or updated topic for this feature pack

Developing Web services applications from JavaBeans

Web services can be developed from existing JavaBeans.

Before you begin

Set up a development environment for Web services.

About this task

Developing Web services based on the JAX-WS programming model New or updated for this feature pack
Best practice: The WebSphere Application Server Version 6.1 Feature Pack for Web Services extends the capabilities of this product to introduce support for the Java API for XML-Based Web Services (JAX-WS) 2.0 programming model. JAX-WS is the next generation Web services programming model complimenting the foundation provided by the Java API for XML-based RPC (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

To develop Web services based on the JAX-WS programming model, you can use a bottom-up development approach when you start from JavaBeans or you can use a top-down development approach when you start with an existing Web Services Description Language (WSDL) file. When developing a JAX-WS Web service starting from JavaBeans, you can use a bean that already exists and then enable the implementation for JAX-WS Web services. The use of annotations simplifies the enabling of a bean for Web services. Adding the @WebService annotation to the bean defines the application as a Web service and how a client can access the Web service. JavaBeans can have a service endpoint interface, but it is not required. Enabling JavaBeans for Web services includes annotating the bean and the optional service endpoint interface, assembling all artifacts required for the Web service, and deploying the application into the WebSphere Application Server environment. You are not required to develop a WSDL file because the use of annotations can provide all of the WSDL information necessary to configure the service endpoint or the client. It is a best practice to develop a WSDL file. JAX-WS Web services are only supported over an HTTP transport.

Developing Web services based on the JAX-RPC programming model

To develop Web services based on the JAX-RPC programming model, you can use a bottom-up development approach when you start from JavaBeans. You can also develop a JAX-RPC Web service from an enterprise bean. You can use a top-down approach to develop a Web service with an existing Web Services Description Language (WSDL) file using a bean or develop a Web service with an existing WSDL file using an enterprise bean. When developing a JAX-RPC Web service starting from JavaBeans, you need develop a new WSDL file. You can use existing JavaBeans and then enable the implementation for Web services. Enabling JavaBeans for Web services includes developing the service endpoint interface, developing a WSDL file that is the description of the Web service, generating and configuring the deployment descriptors, assembling all artifacts required for the Web service, and deploying the application into the WebSphere Application Server environment.

Procedure

  1. 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.
  2. Access an existing JavaBeans Web archive (WAR) file.
  3. Develop a service endpoint interface.
  4. Develop the Java artifacts.
  5. Complete the JavaBeans implementation. Write your JavaBeans implementation to complete your Web service application.
  6. Configure the webservices.xml deployment descriptor (JAX-RPC applications only). Configure the webservices.xml deployment descriptor so that WebSphere Application Server can process the incoming Web services requests.
  7. Configure the ibm-webservices-bnd.xmi deployment descriptor (JAX-RPC applications only). Configure the ibm-webservices-bnd.xml deployment descriptor so that WebSphere Application Server can process the incoming Web services requests.
  8. (Optional) Customize URL patterns in the web.xml file (JAX-WS applications only). When the WSDL file that is associated with your service implementation class contains a single port definition, you can choose to use the default URL pattern or you can customize the URL pattern within the web.xml file. When the WSDL file that is associated with your service implementation class contains multiple port definitions within the same service definition, customized URL patterns are required.
  9. Assemble a WAR file that is enabled for Web services from Java code. You can assemble the artifacts that are required to enable the Web module for Web services into a WAR file.
  10. Assemble a WAR file that is enabled for Web services into an EAR file. You can assemble the artifacts that are required to enable the Web module for Web services into an EAR file.
  11. Deploy the EAR file into WebSphere Application Server. You can now deploy the EAR file that has been configured and enabled for Web services into the application server.

Results

You have a Web service developed from JavaBeans.

What to do next

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

New or updated for this feature pack The Feature Pack for Web Services provides Samples that demonstrate JAX-WS-based Web services using many of the new functions and standards supported in this Feature Pack. The Samples demonstrate the simple message exchange patterns using both synchronous and asynchronous invocation of Web services in SOAP 1.1 and SOAP 1.2 environments. The samples demonstrate the use of JavaBeans artifacts and static service endpoints and proxy-based clients. To learn more about these Samples, see the Samples readme located in the app_server_root/samples/lib/WebServicesSamples directory. Refer to the topic on installing the Samples using the administration console to learn how to install these Samples onto an application server that has been augmented with a Web services profile.




In this information ...


Related concepts
New or updated for this feature pack JAX-WS

IBM Redbooks, demos, education, and more


Use IBM Suggests to retrieve related content from ibm.com and beyond, identified for your convenience.

This feature requires Internet access.

IBM Suggests
Task topic    

Terms of Use | Feedback

Last updated: Nov 25, 2008 2:35:59 AM CST
http://publib.boulder.ibm.com/infocenter/wasinfo/v6r1/index.jsp?topic=/com.ibm.websphere.wsfep.multiplatform.doc/info/ae/ae/twbs_devnew1.html