Before running the WebService Over JMS sample you must create JNDI administered objects for Client Message Flow and WebService Message Flow. In the sample WebSphere MQ is used as the JMS provider, so you must create the administered objects using the JMSAdmin tool.
The JMSAdmin tool is located in install_dir/java/bin on Unix, and install_dir\java\bin on Windows, where install_dir is the directory in which WebSphere MQ is installed.
In the RetailMsgFlowProject , there is "jms.defs" file under "objects" folder which you need
to use
with the JMSAdmin tool.
Note : The "jms.def" contains
the JNDI object definitions for default Queue Manager. If you are
using any other legacy Queue Manager to run this Sample, then
change the Queue Manager and Port number in the "jms.def" file.
Before using the JMSAdmin tool, modify the JMSAdmin.config file as follows.
To modify the JMSAdmin.config file:
# The following line specifies which JNDI service provider is in use.
# It currently indicates an LDAP service provider. If a different
# service provider is used, this line should be commented out and the
# appropriate one should be uncommented.
#
#INITIAL_CONTEXT_FACTORY=com.sun.jndi.ldap.LdapCtxFactory
INITIAL_CONTEXT_FACTORY=com.sun.jndi.fscontext.RefFSContextFactory
#INITIAL_CONTEXT_FACTORY=com.ibm.ejs.ns.jndi.CNInitialContextFactory
#INITIAL_CONTEXT_FACTORY=com.ibm.websphere.naming.WsnInitialContextFactory
#
# The following line specifies the URL of the service provider's initial
# context. It currently refers to an LDAP root context. Examples of a
# file system URL and WebSphere's JNDI namespace are also shown, commented out.
#
#PROVIDER_URL=ldap://polaris/o=ibm,c=us
PROVIDER_URL=file:/C:\JNDI-Directory
#PROVIDER_URL=iiop://localhost/
#
When you have saved the file, create the JNDI-Directory directory as it appears in the PROVIDER_URL line.
<myuser>
with the user name you use to run the broker. When you have saved the
file, create the JNDI-Directory directory as it appears in the
PROVIDER_URL line.
# The following line specifies the URL of the service provider's initial
# context. It currently refers to an LDAP root context. Examples of a
# file system URL and WebSphere's JNDI namespace are also shown, commented out.
#
#PROVIDER_URL=ldap://polaris/o=ibm,c=us
PROVIDER_URL=file:/home/<myuser>/JNDI-Directory
#PROVIDER_URL=iiop://localhost/
#
Now you are ready to create the objects.
You create the objects, by running JMSAdmin, using the "jms.defs" file as input. This file is present in "objects" folder of the RetailMsgFlow Project. On the command line, enter the following commands:
On Windows:
cd mq_install_dir\Java\bin
JMSAdmin < "workspace_path\RetailMsgFlowProject\objects\jms.defs"
On Linux:
cd mq_install_dir/java/bin
./JMSAdmin < workspace_path/RetailMsgFlowProject/objects/jms.defs
Where mq_install_dir is the location in which WebSphere
MQ is installed, and workspace_path is the full path to
the Message Brokers Toolkit workspace directory.
On AIX, Solaris,
HP-UX:
Copy / ftp the jms.defs file from the Toolkit system where you
are working to the local file system. This file are available on
the following path,
On Windows:
"workspace_path\RetailMsgFlowProject\objects\jms.defs"
On linux:
workspace_path/RetailMsgFlowProject/objects/jms.defs
cd mq_install_dir/java/bin
./JMSAdmin < (FTP-PATH)/jms.defs [ FTP-PATH is were you have copied or ftp the "jms.defs" file on Unix system)
Where mq_install_dir is the location in which WebSphere MQ is installed, and workspace_path is the full path to the Message Brokers Toolkit workspace directory.The objects and the .bindings file are created.
You need to tell the JMS nodes in the message flows where to find the .bindings file that you just created.
To configure the JMS nodes with the location of the .bindings file:
The message flows are now configured, and Create the new Bar file
and add the sample message flows and message sets.
Deploy the bar on the legacy broker using the below instructions.
To deploy the RETAIL_CLIENT.msgflow, RETAIL_WEBSERVICES.msgflow and RetailMsgSet message set, create a broker archive (BAR) file that contains all the two message flows and the message set.
To create the BAR file:
This step must be performed on Unix but not on Windows. So skip this step if you are working only on Windows.
To set up the ODBC drivers on Unix:
ESDSALES= IBM DB2 ODBC Database
ESDSTOCK= IBM DB2 ODBC Database
[ESDSALES]
Driver=/opt/IBM/db2/V8.1/lib/libdb2.so
Description=ESDSALES DB2 ODBC Database
Database=ESDSALES
[ESDSTOCK]
Driver=/opt/IBM/db2/V8.1/lib/libdb2.so
Description=ESDSTOCK DB2 ODBC Database
Database=ESDSTOCK
The ODBC drivers are now configured correctly.
You are now ready to run the sample.