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

You need the following artifacts...

Use the Assembly Toolkit to assemble Web service-enabled client applications.

To assemble the client code and artifacts that enable the application client to access a Web service...

  1. Start the Assembly Toolkit.

  2. Click File > Import to import the WAR file into the Assembly Toolkit.

  3. Open the J2EE perspective by clicking Windows >Open Perspective > Other >J2EE.

  4. Switch to the Project Navigator pane by clicking the Project Navigator tab.

  5. Locate the project for the file you just imported in the Project Navigator pane.

  6. Expand the webContemt entry so the WEB-INF directory is displayed. Expand the WEB-INF directory.

  7. Right-click on the WEB-INF directory and select New > Folder. Create a subfolder named wsdl in the WEB-INF directory.

    1. Copy the WSDL file to the WEB-INF\wsdl directory by right-clicking on the wsdl directory and click File > Import > File system. Browse the WSDL file for this Web service and click Finish.

    2. Copy the webservicesclient.xml and the JAX-RPC mapping file in the WEB-INF subdirectory in the same manner you copied the WSDL file.The JAX-RPC mapping file is indicated by the <jaxrpc-mapping-file> element in the webservicesclient.xml file.

    3. (Optional) Place the ibm-webservicesclient-ext.xmi and ibm-webservicesclient-bnd.xmi file in the WEB-INF subdirectory, if used.

  8. Assemble the WAR file into an EAR file using typical assembly techniques.

The artifacts required to enable the client module to use Web services are added to the module.

 

Usage Scenario

This example uses a WAR file named AddressBookWeb.war and an EAR file named AddressBook.ear

WEB-INF/MANIFEST.MF
WEB-INF/web.xml"
WEB-INF/wsdl/AddressBook.wsdl
WEB-INF/webservicesclient.xml
WEB-INF/AddressBook_mapping.xml
WEB-INF/ibm-webservicesclient-ext.xmi (optional)
WEB-INF/ibm-webservicesclient-bnd.xmi 
com/i../WAS51/samples/webservices/addr/Address.class
com/i../WAS51/samples/webservices/addr/AddressBook.class
com/i../WAS51/samples/webservices/addr/AddressBookClient.class
com/i../WAS51/samples/webservices/addr/AddressBookService.class
...other generated classes...

After assembling the AddressBookWeb.war file into the AddressBook.ear file, the AddressBook.ear file contains the following files

WEB-INF/MANIFEST.MF 
AddressBookWeb.war
WEB-INF/application.xml

Configure the webservicesclient.xml deployment descriptor .

 

See Also

Web services
Testing Web services-enabled clients
Configuring the ibm-webservicesclient-bnd.xmi deployment descriptor
Using Web services based on Web Services for J2EE
Developing Web services clients based on Web Services for J2EE
Artifacts used to develop Web services based on Web Services for J2EE