GenericWebServiceWAS6 Sample For IBM WebSphere Application Server 6.1
SAMPLE OVERVIEW
===============
This sample demonstrates how to communicate with the IBM Content Manager Enterprise Edition
Web services server by sending XML request messages and binary attachments
to the Generic Web services (named CMBGenericWebService) running on WAS 6.1. It
calls the runtime interfaces implemented by CMWebService Web services, with
minimal system administration and metadata query functionality. The sample also
demonstrates how to use MIME, the Multipurpose Internet Mail Extensions, to
send binary data to and from CMBGenericWebService Web services.
The GenericWebServiceWAS6 sample is in directory IBMCMROOT/samples/webservices/
GenericWebService/java/WAS6/base.
The following operations are implemented in the sample:
- Create new insurance policy and claim form documents
Demonstrates importing new items into the database.
- Retrieve a policy and a claim form
- Demonstrates retrieving items with and without attachments (content parts)
from the database.
- Demonstrates retrieving multiple items using one request.
- Search the policies
- Demonstrates sending queries to the Web services and receiving search results.
- Update the policies and claim forms
- Updating attributes in the root object
- Replacing the base part content in the root object with an attachment
- Updating the attribute of a child component
- Adding a child component
- Deleting a child component
- Delete a policy and a claim form document by BatchRequest
Demonstrates the batch request that groups independent requests into a
single request performed in one trip to the server.
- Create and delete links
- Perform folder operations
- Create folder
- Add items to folder
- Retrieve items from a folder
- Delete an item in a folder
- Delete folder
- Perform document routing operations
- Listing of the currently active processes.
- Starting an item on a document routing process.
- Listing work packages for a specified worklist.
- Continuing a specified work package on a process.
- Terminating the process on which a specified work package is
being routed.
LOAD SAMPLE DATA
================
You must load the XYZ sample data from the IBM Content Manager Enterprise Edition First
steps application prior to running the GenericWebService client sample. The
sample uses the XYZ Insurance data model--specifically, the XYZ_InsPolicy and
XYZ_ClaimForm item types to demonstrate Web services client programming.
The steps for loading the XYZ Insurance Sample Data are
1. Load the XYZ Insurance sample schema from the IBM Content Manager Enterprise Edition
First Steps application. For more information about First Steps, see the
"System Administration Guide".
2. Verify the XYZ Insurance sample schema from an IBM Content Manager Enterprise Edition
Client for Windows or the system administration client.
SET UP THE SAMPLE
=================
1) Install the IBM Content Manager Enterprise Edition Web services Toolkit.
1.1 Install IBM Content Manager Enterprise Edition with Web Services Toolkit on
the machine on which the GenericWebService sample will be run. See
"Planning and Installing Your Content Management System" for details.
2) Verify that CMBGenericWebService is running
2.1 The following URL will show a test page with the message "CMBGenericWebService
Hi there, this is a Web service!" when loaded in a web browser:
http://<Web services host>/CMBGenericWebService/services/CMBGenericWebService
After entering the URL, if nothing is displayed, the server where the IBM
Content Manager Enterprise Edition Web services application is deployed must be
started before proceeding.
3) Configure the sample code
3.1 Install WebSphere Application Server 6.1 on the machine you will
run the sample on.
3.2 Configure the CLASSPATH to include the following jar files from
WebSphere Application Server:
- com.ibm.ws.webservices.thinclient_6.1.0.jar
Example:
Where environment variable "WAS_HOME" indicates WebSphere Application
Server 6.1 install location.
For Windows:
> set classpath=%classpath%;%WAS_HOME%\runtimes\
com.ibm.ws.webservices.thinclient_6.1.0.jar
3.3 Compile the proxy classes and GenericWebServiceSample.java
Example:
Where environment variable "IBMCMROOT" indicates IBM Content
Manager 8.4 install location.
For Windows:
> cd %IBMCMROOT%\samples\webservices\GenericWebService\java\WAS6
> javac base\*.java
RUN THE SAMPLE
==============
Run the GenericWebServiceSample sample
The example command line:
>java base.GenericWebServiceSample icmnlsdb icmadmin password
http://<Web services host>/CMBGenericWebService/services/CMBGenericWebService
where icmnlsdb is a library server name,
icmadmin is an userid in the library server,
"password" is the password to the userid,
Optionally the URL to Generic Web services can be specified as the fourth
parameter. It will override the default Web services URL hard-coded in the
sample code.
APPENDIX
========
If the proxy classes in this sample do not work with a particular version of
WebSphere Application Server, the proxy classes must be regenerated. Complete
the following steps to finish the task:
1) Get the WSDL file CMBGenericWebService.wsdl for the Generic Web services
Open URL http:
//<Web services host>/CMBGenericWebService/services/CMBGenericWebService?wsdl
in a web browser window and save the page, for example, C:\WSDL
2) Regenerate the proxy classes using WebSphere WSDL2Java tool
Suppose that the environment variable "WAS_HOME" indicates WebSphere
Application Server 6.1 install location. Open a command line window. Change
to the directory where CMBGenericWebService.wsdl is located,
for example, C:\WSDL.
Enter the following command:
%WAS_HOME%\bin\WSDL2Java -role client
-NStoPkg http://was60.webservices.mm.ibm.com=base CMBGenericWebService.wsdl
The newly generated proxy classes are in C:\WSDL\base
3) Replace the proxy classes in the sample
Save a copy of the files in the Web services sample directory, for example
%IBMCMROOT%\samples\webservices\GenericWebService\java\WAS6\base.
Then copy all of the newly generated proxy classes in C:\WSDL\base
to %IBMCMROOT%\samples\webservices\GenericWebService\java\WAS6\base,
to overwrite the existing ones.
4) Recompile the proxy classes and run the sample again.
Changes needed before running the sample under CICS
===================================================
1) Modify the main program (GenericWebServiceSample.java) so that it does not
require input arguments
2) Add the following to the JVM profile:
2.1 Set WORKDIR to the sample directory:
$IBMCMROOT/samples/webservices/GenericWebService/java/WAS6
2.2 Set CLASSPATH_PREFIX to include the thin client jar:
$WAS_HOME/runtimes/com.ibm.ws.webservices.thinclient_6.1.0.jar
2.3 Set CLASSPATH_SUFFIX to include the thin client jar file and the sample directory:
$WAS_HOME/runtimes/com.ibm.ws.webservices.thinclient_6.1.0.jar:\
$IBMCMROOT/samples/webservices/GenericWebService/java/WAS6:\
$IBMCMROOT/samples/webservices/GenericWebService/java/WAS6/base
Where environment variable "IBMCMROOT" indicates IBM Content
Manager 8.4 install location.