开始之前:
如果要在 Linux 上运行该样本,必须完成以下步骤:
<mq_install_directory>/java/lib/com.ibm.mqjms.jar
<JAVA_HOME>/bin
以下指示信息假设 WebSphere MQ 安装在 mq_install_dir 目录中。JMSAdmin 工具和 JMSAdmin 配置文件位于以下位置:
在“SOAP 节点样本流”项目中,必须将 SOAPJMSSample.defs 文件与 JMSAdmin 工具配合使用。
必须先修改 JMSAdmin.config 文件,然后才能使用 JMSAdmin 工具。
要修改 JMSAdmin.config 文件:
# The following line specifies which JNDI service provider is in use. # It currently indicates a File System Context. If a different # service provider is used, this line must be commented out, and the # appropriate one must be uncommented. # # com.sun.jndi.fscontext.RefFSContextFactory is the FileSystem JNDI Context # #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 initial context # for the service provider. It currently refers to a File System Context. # Examples of an LDAP root context URL and the JNDI namespace for WebSphere # are also shown, commented out. # #PROVIDER_URL=ldap://localhost/o=ibm,c=us PROVIDER_URL=file:/C:/SOAPJNDIBindings #PROVIDER_URL=iiop://localhost/
确保 INITIAL_CONTEXT_FACTORY 设置为 com.sun.jndi.fscontext.RefFSContextFactory。
现在,您可以创建对象了。
通过运行 WebSphere MQ JMSAdmin 工具,您可以创建 JNDI 受管对象以配置样本中使用的 JMS 连接工厂和目标。
您可以通过运行 JMSAdmin 工具并使用 SOAPJMSSample.defs 文件作为输入来创建对象。
在命令行上,输入以下命令:
cd mq_install_dir\bin setmqenv -p "mq_install_dir" cd mq_install_dir\java\bin JMSAdmin < "workspace_path\SOAPNodesSampleFlows\SOAPJMSSample.defs"
cd mq_install_dir/java/bin . ./setjmsenv ./JMSAdmin < workspace_path/SOAPNodesSampleFlows/SOAPJMSSample.defs
其中,WebSphere MQ 安装在位置 mq_install_dir 中,而 workspace_path 是 IBM Integration Toolkit 工作空间目录的完整路径。
将创建对象和 .bindings 文件。
已经用 .bindings 文件的位置配置了 SOAP 节点。但是,如果您在其他位置创建了 .bindings 文件,那么必须使用该 .bindings 文件的位置重新配置 SOAP 节点。请完成以下部分中的步骤:“使用 .bindings 文件的位置配置 SOAP 节点”。
要确保消息流中的 SOAP 节点了解您创建的 .bindings 文件的位置,请使用以下部分中的步骤:“使用 .bindings 文件的位置配置 SOAP 节点”。
要部署经过修改的 SOAPNodesSampleConsumer 和 SOAPNodesSampleProvider 流,请重新构建同时包含这两个消息流的代理归档 (BAR) 文件。
构建 BAR 文件:
现在,您可以运行该样本,请参阅运行“SOAP 节点”样本。可以使用同样的流测试,因为客户机流由 WebSphere MQ 队列驱动。