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


 

+

Search Tips   |   Advanced Search

 

Now that we have generated the application artifacts, we need to assemble these artifacts to create an EAR file used in the Web services application.

For JAX-WS Web service applications, we need the portable artifacts that are generated by wsimport 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:

For JAX-RPC Web service applications, we need the following artifacts that are generated from the WSDL2Java command-line tool to complete this task:

Use assembly tools included with WAS 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:

  1. Start an assembly tool.

  2. If we have not done so already, configure the assembly tool so that it works on Java EE modules. we need to make sure that the Java EE and Web categories are enabled.

  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 the JAR files to the assembly tool.

  5. Assemble the JAR file into an EAR file using typical assembly techniques if the client runs in a container.

 

Results

we 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 JAX-WS applications, we are ready to deploy the Web services client application.

For JAX-RPC applications, we need to configure the client deployment descriptor bindings so that the client can communicate with a Web service that is deployed on a server.

 

Related tasks

Web services
Assembly tools
Testing Web services-enabled clients
Task overview: Implement Web services applications
Implementing JAX-WS Web services clients
Implementing JAX-RPC Web services clients
Deploy a Web services client application
Set the JAX-RPC Web services client deployment descriptor with an assembly tool

 

Related

Artifacts used to develop Web services
wsimport command for JAX-WS applications
WSDL2Java command for JAX-RPC applications