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. Assemble a web services-enabled client JAR file that enables the application client to access a web service into an EAR file.
Before you begin
- Service Endpoint Interface (SEI)
- Service class
- Exception classes that are mapped from the
wsdl:faultclass (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.
- 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.
About this task
You can use assembly tools included with WebSphere® Application Server to assemble web services-enabled client applications. If you use Rational® Application Developer for the assembly, refer to the Rational Application Developer documentation.
Assemble the client code and artifacts that enable the application client to access a web service with the following steps.
Procedure
- Start an assembly tool.
- 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.
- Import the client implementation and the artifacts generated by the command-line tooling into the assembly tool.
- Migrate JAR files created with the Rational Application Developer assembly tool. To migrate files, import your JAR files to the assembly tool.
- Assemble the JAR file into an enterprise archive (EAR) file using typical assembly techniques if the client runs in a container.
Results
Example
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...META-INF/MANIFEST.MF
AddressBookClient.jar
META-INF/application.xmlWhat 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.