Having problems with your account or logging in?
A lot of changes are happening in the community right now. Some may affect you. READ MORE HERE
Highlighted
Amadiza79
Senior Member.
397 views

Websphere mq

Jump to solution

Hello,
I am a new beginner user of sv.

How to work with web sphere MQ's which are using xml messages as input and output Hi , I have a requirement to create a virtual service which should listen to message . Pick the values from the request xml and post the message to another queue. Here the request and response are in XML .
I already create destination queue and response queue on websphere.

When, I click on simulate, I cannot see messages in queue.

I dont know if I need c# script or not.
please, Do you have a idea?

0 Likes
1 Solution

Accepted Solutions
Jakub Honored Contributor.
Honored Contributor.

Re: Websphere mq

Jump to solution

Hi,

virtual service listens on the queue for the requests. Once it comes, it sends response, so what you are experiencing is correct and expected behavior - just switching to simulation is not enough, you need to send the request.

---
Service Virtualization R&D
0 Likes
2 Replies
Jakub Honored Contributor.
Honored Contributor.

Re: Websphere mq

Jump to solution

Hi,

virtual service listens on the queue for the requests. Once it comes, it sends response, so what you are experiencing is correct and expected behavior - just switching to simulation is not enough, you need to send the request.

---
Service Virtualization R&D
0 Likes
Amadiza79
Senior Member.

Re: Websphere mq

Jump to solution

Thank you for answering me quickly. I want to know, if I need to write a program in C# to send my messages in the queue. Does this program have to be placed in the SV shared script? And how to run this program in or out of SV?
In pure java development, I understand, but now I'm lost.

using System;
using System.Collections;
using HP.SV.DotNetRuleApi;
using HP.SV.CSharp;
using IBM.WMQ;


namespace HP.SV{
	public class CSharpRule{
		public static void Execute(HpsvRootObject hpsv){
            Hashtable properties = new Hashtable();
            properties.Add(MQC.TRANSPORT_PROPERTY, "TCP");
            //hostname of the MQ server
            properties.Add(MQC.HOST_NAME_PROPERTY, "write-your-hostname-here");
            //TCP listener port
            properties.Add(MQC.PORT_PROPERTY, 1421);
            properties.Add(MQC.CHANNEL_PROPERTY, "QM_TEST.SVRCONN");
            properties.Add(MQC.CCSID_PROPERTY, 437);
            properties.Add(MQC.USER_ID_PROPERTY, "username");
            properties.Add(MQC.PASSWORD_PROPERTY, "password");
            MQQueueManager qm = new MQQueueManager("queue-manager-name", properties);
            MQQueue q = qm.AccessQueue("queue-name", MQC.MQOO_OUTPUT + MQC.MQOO_FAIL_IF_QUIESCING);
            MQMessage queueMessage = new MQMessage();
            queueMessage.WriteString("Hello World from HPE SV!");
            queueMessage.Format = MQC.MQFMT_STRING;
            q.Put(queueMessage);
        }
    }
}

 

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.