Assembling a web services-enabled client JAR file into an EAR file

Now that you have generated your application artifacts, you need to assemble these artifacts to create an enterprise archive (EAR) file that is used in the web services application.

Before you begin

For Java™ API for XML-Based Web Services (JAX-WS) web service applications, you need the portable artifacts that are generated by the wsimport command-line tool when starting from a WSDL file to complete this task. The wsimport tool processes a WSDL file as input and generates the following portable artifacts:
  • Service Endpoint Interface (SEI)
  • Service class
  • Exception classes that are mapped from the wsdl:fault class (if any)
  • Java Architecture for XML Binding (JAXB) generated type values which are Java classes mapped from XML schema types
  • An assembled client module that contains the implementation, all of the classes generated by the wsimport command-line tool and the ejb-jar.xml deployment descriptor or the application-client.xml deployment descriptor. This module can be:
    • An application client module that contains the META-INF/application-client.xml file.
    • An Enterprise JavaBeans (EJB) module that contains the META-INF/ejb-jar.xml file.
For Java API for XML-based RPC (JAX-RPC) web service applications, you need the following artifacts that are generated from the WSDL2Java command-line tool to complete this task:
  • An assembled client module that contains the implementation, all of the classes generated by the WSDL2Java command-line tool and the ejb-jar.xml deployment descriptor or the application-client.xml deployment descriptor. This module can be:
    • An application client module that contains the META-INF/application-client.xml file.
    • An Enterprise JavaBeans (EJB) module that contains the META-INF/ejb-jar.xml file.
  • The WSDL file that you used to develop the client.
  • The templates for the ibm-webservicesclient-ext.xmi and ibm-webservicesclient-bnd.xmi deployment descriptor, if used.
  • A generated Java API for XML-based remote procedure call (JAX-RPC) mapping deployment descriptor.
Restriction: 請勿在套裝於應用程式保存檔內的檔案名稱中包含井字號 (#)。 由於內部處理之故,當應用程式保存檔內的檔案名稱中包含井字號時,應用程式伺服器將無法正確部署應用程式。如果發生這種失敗,則可能會在處理應用程式時發生異常狀況。此外,在部署應用程式之後,部分應用程式可能會遺失。 為處理這個問題,請將應用程式保存檔內的所有檔名重新命名,讓它們不包含井字號。

About this task

You can use assembly tools included with WebSphere® Application Server to assemble web services-enabled client applications.

Assemble the client code and artifacts that enable the application client to access a web service with steps provided:

Procedure

  1. Start an assembly tool. Read about starting the assembly tool in the Rational® Application Developer documentation.
  2. If you have not done so already, configure the assembly tool so that it works on Java EE modules. You need to make sure that the Java EE and Web categories are enabled. Read about configuring the assembly tool in the Rational Application Developer documentation.
  3. Import the client implementation and the artifacts generated by the command-line tooling into the assembly tool.
  4. Migrate JAR files created with the Rational Application Developer assembly tool. To migrate files, import your JAR files to the assembly tool. Read about migrating code artifacts to an assembly tool in the Rational Application Developer documentation.
  5. Assemble the JAR file into an enterprise archive (EAR) file using typical assembly techniques if the client runs in a container.

Results

You have assembled the artifacts required to enable the client application for web services into an EAR file.

Example

This example of the assembly process uses the AddressBookClient.jar JAR file the AddressBookClient.ear EAR file:
META-INF/MANIFEST.MF
META-INF/application-client.xml
META-INF/wsdl/AddressBook.wsdl
META-INF/AddressBook_mapping.xml

com/ibm/websphere/samples/webservices/addr/Address.class
com/ibm/websphere/samples/webservices/addr/AddressBook.class
com/ibm/websphere/samples/webservices/addr/AddressBookClient.class
com/ibm/websphere/samples/webservices/addr/AddressBookService.class
...other generated classes...
After assembling the AddressBookClient.jar file into the AddressBookClient.ear file, the AddressBookClient.ear file contains the following files:
META-INF/MANIFEST.MF 
AddressBookClient.jar 
META-INF/application.xml

What to do next

For Java API for XML-Based Web Services (JAX-WS) applications, you are ready to deploy the web services client application.

For Java API for XML-based RPC (JAX-RPC) applications, you need to configure the client deployment descriptor bindings with an assembly tool so that the client can communicate with a web service that is deployed on a server.


指出主題類型的圖示 作業主題



時間戳記圖示 前次更新: July 9, 2016 11:17
http://www14.software.ibm.com/webapp/wsbroker/redirect?version=cord&product=was-nd-mp&topic=twbs_assembclient
檔名:twbs_assembclient.html