WebSphere Application Server Network Deployment, Version 6.0.x   Operating Systems: AIX, HP-UX, Linux, Solaris, Windows
             [TIP: Focusing the table of contents and search results]

Developing and deploying Web services clients

You can develop Web services clients based on the Web Services for Java 2 Platform, Enterprise Edition (J2EE) specification and the supported Web services development programming models.

About this task

The Web services client programming model provides the guidelines for accessing Web services in a J2EE environment. Web services clients can be developed based on the Web Services for Java 2 Platform, Enterprise Edition (J2EE) specification and the Java API for XML-based remote procedure call (JAX-RPC) specification. There are two types of basic JAX-RPC Web services clients.
  • Managed clients

    Web services for J2EE clients are defined by Java Specification Requirements (JSR) 109 and are known as managed clients since they run in a J2EE container. These clients are packaged as EAR files and contain components that act as service requesters. These components can be a J2EE client application, a Web component such as a servlet or JSP, or a session EJB. Web services managed clients use JSR 109 APIs and deployment information to lookup and invoke a web service.

  • Unmanaged clients

    J2SE clients that use the JAX-RPC runtime to invoke Web services and do not run in any J2EE container are known as unmanaged clients. A Web services unmanaged client is a stand-alone Java client that can directly inspect a WSDL file and formulate the calls to the Web service by using the JAX-RPC APIs directly. These clients are packaged as Java JAR files which do not contain any deployment information.

For a Java application to act as a Web service client, a mapping between the Web Services Description Language (WSDL) file and the Java application must exist. The mapping is defined by the Java API for XML-based RPC (JAX-RPC) specification. You can use a Java component to implement a Web service by specifying the component interface and binding information in the WSDL file and designing the application server infrastructure to accept the service request. This entire process is based on the Web Services for J2EE specification. The JAX-RPC specification defines the mapping between a WSDL file, Java code and XML Schema types.

Procedure

  1. Obtain the Web Services Description Language (WSDL) document for the Web service that you want to access.

    You can locate the WSDL from the services provider through e-mail, through a Uniform Resource Locator (URL) or by looking it up in a Universal Description, Discovery and Integration (UDDI) registry.

  2. Develop client bindings from a WSDL file.

    The WSDL2Java command-line tool is run against your WSDL file to develop client bindings.

    The information needed to invoke the Web service is generated, including the service endpoint interface and implementations, the generated service interface and the ibm-webservicesclient-bnd.xmi and ibm-webservicesclient-ext.xmi deployment descriptors.

  3. Complete the client implementation. Write your client application code that is used to invoke the Web service.
    See Chapter 4 of the JSR 109 specification. You can access the specification through Web services: Resources for learning.
    Note: If an application creates a number of threads in the JSR 109 client, the meta data (including the WebSphere Application Server configuration) is not copied to the thread, and the Global Security Handler is not called.

    You can also review the GetQuote client in the WebServicesSamples application available in the Samples Gallery.

  4. (Optional) Assemble a Web services-enabled client Java archive (JAR) file into an enterprise archive (EAR) file. Complete this step if you are developing a managed client that runs in the J2EE client container.
  5. (Optional) Assemble a Web services-enabled client Web archive (WAR) file into an enterprise archive (EAR) file. Complete this step if you are developing a managed client that runs in the J2EE client container.
  6. (Optional) Configure the client deployment descriptor . Complete this step if you are developing a managed client that runs in the J2EE client container.
  7. (Optional) Configure the ibm-webservicesclient-bnd.xmi deployment descriptor. Complete this step if you are deploying a managed client that runs in the J2EE client container and you want to override the default client settings. See ibm-webservicesclient-bnd.xmi assembly properties for more information about the ibm-webservicesclient-bnd.xmi deployment descriptor.
  8. (Optional) Deploy the Web services client application. Complete this step to deploy a managed client that runs in the J2EE client container.
  9. Test the Web services-enabled client application. You can test an unmanaged client JAR file or a managed client application.

Results

You have created and tested a Web services client application.

What to do next

After you develop a Web services application client, and the client is statically bound, the service endpoint used by the implementation is the one that is identified in the WSDL file that you used during the development process. During or after installation of the Web services application, you might want to change the service endpoint. You can change the endpoint with the administrative console or the wsadmin scripting tool.




Sub-topics
Developing client bindings from a WSDL file for a JAX-RPC client
Changing SOAP message encoding to support WSI-Basic Profile
Configuring the JAX-RPC Web services client deployment descriptor with an assembly tool
Configuring the JAX-RPC client deployment descriptor for handler classes
Configuring the Web services client bindings in the ibm-webservicesclient-bnd.xmi deployment descriptor
Assembling a Web services-enabled client JAR file into an EAR file
Assembling a Web services-enabled client WAR file into an EAR file
Deploying a Web services client application
Testing Web services-enabled clients
Implementing extensions to the JAX-RPC and Web Services for J2EE client programming models
Related concepts
Web services
Related tasks
Setting up a development environment for Web services
Task overview: Implementing Web services applications
Related reference
Web services client to Web container optimized communication
Artifacts used to develop Web services
Web services enabled module - deployment descriptor settings (ibm-webservices-bnd.xmi file)
Task topic    

Terms of Use | Feedback

Last updated: Mar 8, 2007 8:14:28 PM CST
http://publib.boulder.ibm.com/infocenter/wasinfo/v6r0/index.jsp?topic=/com.ibm.websphere.nd.doc/info/ae/ae/twbs_devwbsclient.html

© Copyright IBM Corporation 2006. All Rights Reserved.
This information center is powered by Eclipse technology. (http://www.eclipse.org)