<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Waldemar's blog &#187; web services</title>
	<atom:link href="http://blog.testsautomation.com/tag/web-services/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.testsautomation.com</link>
	<description>Live fast, die old...</description>
	<lastBuildDate>Mon, 02 Jan 2012 20:36:41 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>IBM WebSphere MQ testing using LoadRunner</title>
		<link>http://blog.testsautomation.com/2009/02/ibm-websphere-mq-testing-using-loadrunner/</link>
		<comments>http://blog.testsautomation.com/2009/02/ibm-websphere-mq-testing-using-loadrunner/#comments</comments>
		<pubDate>Mon, 23 Feb 2009 20:09:10 +0000</pubDate>
		<dc:creator>Waldemar</dc:creator>
				<category><![CDATA[LoadRunner]]></category>
		<category><![CDATA[IBM WebSphere MQ]]></category>
		<category><![CDATA[JMS]]></category>
		<category><![CDATA[web services]]></category>

		<guid isPermaLink="false">http://blog.testsautomation.com/?p=113</guid>
		<description><![CDATA[My first script for WebSphere MQ testing was written in Java as Java Vuser script. It was pretty simple since I was using just MQ JMS API.  There is lots of examples howto connect to WebSphere in Java. Here is one http://hursleyonwmq.wordpress.com/2007/05/29/simplest-sample-applications-using-websphere-mq-jms/. But howto test WebSphere MQ if you don&#8217;t have Java license in you [...]]]></description>
			<content:encoded><![CDATA[<p>My first script for WebSphere MQ testing was written in Java as Java Vuser script. It was pretty simple since I was using just MQ JMS API.  There is lots of examples howto connect to WebSphere in Java. Here is one <a title="example" href="http://hursleyonwmq.wordpress.com/2007/05/29/simplest-sample-applications-using-websphere-mq-jms/" target="_blank">http://hursleyonwmq.wordpress.com/2007/05/29/simplest-sample-applications-using-websphere-mq-jms/</a>.</p>
<p>But howto test WebSphere MQ if you don&#8217;t have Java license in you LoadRunner?</p>
<p>There is a way to do that. LoadRunner API contains several JMS functions:</p>
<p>jms_receive_message_queue()<br />
jms_send_message_queue()<br />
jms_send_receive_message_queue()<br />
jms_set_general_property()<br />
jms_set_message_property()</p>
<p>First of all you need to have &#8220;Web Services&#8221; license to use them.</p>
<p>Here is what you need to do:</p>
<ul>
<li>Get details of your environment like: MQ server IP, port (probably 1414), Queue Manager name, Queue name and channel name.<br />
Install IBM WebSphere MQ Client on machine where you have LoadRunner Controller (or LoadRunner Generator if you are using remote one). MQ Windows Client for WebSphere 6.0 can be downloaded <a title="here" href="http://www-01.ibm.com/support/docview.wss?uid=swg24009961" target="_blank">here.</a></li>
</ul>
<ul>
<li>Setup details of our WebSphere MQ server on the client. We will use JNDI to store connection details (host, port, etc&#8230;)</li>
</ul>
<ul>
<li> Edit file C:\Program Files\IBM\WebSphere MQ\Java\bin\JMSAdmin.config and set</li>
</ul>
<blockquote><p>INITIAL_CONTEXT_FACTORY=com.sun.jndi.fscontext.RefFSContextFactory<br />
PROVIDER_URL=file:/C:/JNDI</p></blockquote>
<ul>
<li>Create new .scp file and put there your MQ server details. Here an example</li>
</ul>
<blockquote><p>DELETE QCF(QueueConnectionFactory)<br />
DEFINE QCF(QueueConnectionFactory) QMGR(QUEUE_MANAGER) tran(client) chan(SYSTEM.ADMIN.SVRCONN) host(192.168.12.13) port(1414)<br />
DISPLAY QCF(QueueConnectionFactory)<br />
DEFINE Q(MY_QUEUE) QUEUE(MY_QUEUE) QMGR(QUEUE_MANAGER)<br />
DISPLAY Q(MY_QUEUE)<br />
end</p></blockquote>
<ul>
<li>Last step for MQ Client is to generate .bindings file (placed automatically in C:/JNDI) with JMSAdmin tool from C:\Program Files\IBM\WebSphere MQ\Java\bin directory. Assuming that your .scp file is named My_qm.scp, use this command:</li>
</ul>
<blockquote><p>JMSAdmin &lt; My_qm.scp</p></blockquote>
<p>Now in LoadRunner:</p>
<ul>
<li> Create new Web Services script</li>
</ul>
<ul>
<li>Open Run-Time settings (F4) and go to JMS/Advanced</li>
</ul>
<ul>
<li>Change JNDI initial context factory to &#8220;com.sun.jndi.fscontext.RefFSContextFactory&#8221;</li>
</ul>
<ul>
<li>Change JNDI provider URL to &#8220;file:/C:/JNDI&#8221;</li>
</ul>
<ul>
<li>Change JMS connection factory to &#8220;QueueConnectionFactory&#8221; and click OK</li>
</ul>
<p>Use this sample code to send and receive a message from IBM WebSphere MQ:</p>
<pre lang="JAVA">//setting JMS message property JmsMessageID
jms_set_message_property("JMSMessageID","JMSMessageID", "12345");

//sending message
jms_send_message_queue("Sending message","My cool message", "MY_QUEUE");

//receiving message
jms_receive_message_queue("Receiving message", "MY_QUEUE");

//displaying message
lr_message(lr_eval_string("{JMS_message}"));</pre>
<p>Received message is saved in &#8220;JMS_message&#8221; parameter automatically by LoadRunner.</p>
<p>Done. Smart and simple <img src='http://blog.testsautomation.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.testsautomation.com/2009/02/ibm-websphere-mq-testing-using-loadrunner/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

