Performancing Metrics

Vamsi Tokala's blog: Simulating SOAP messages via JMS in LoadRunner using Web Services Protocol

Wednesday, December 2, 2009

Simulating SOAP messages via JMS in LoadRunner using Web Services Protocol

Web services facilitate application to application communication for building integrated systems of web application components and HTTP is the most standard transport protocol used for the communication but it will be difficult to send messages from one subsystem to many using HTTP. Sending SOAP messages via JMS is a viable and a simple option for such requirements.


JMS is a J2EE standard for sending messages, either text or Java objects, between Java clients.


There are two scenarios for communication:


Point-to-Point. JMS implements point-to-point messaging by defining a message queue as the target for a message. Multiple senders send messages to a message queue, and the receiver gets the message from the queue.


Publish-Subscribe. Each message is sent from one publisher to many subscribers through a designated topic. The subscribers only receive messages sent after they have subscribed.


LoadRunner supports both the communication but I will focus sending SOAP over JMS point-to-point communication using LoadRunner in this post.


Vugen supports point to point by allowing you to send and receive JMS messages to and from a queue.


Please follow the steps to simulate JMS traffic to TIBCO in LoadRunner


       1.    Install JDK and set the class path accordingly

       2.    Download TIBCOjms.jar file from the application support team and set the class path of the jar in VUGEN- Runtime settings – Classpath

       3.    Request your application team to provide the following details and update in  Runtime settings

a.    JNDI Initial Context Factory - com.tibco.tibjms.naming.TibjmsInitialContextFactory (For Tibco)

b.    JNDI Provider URL

c.     JNDI Context Factory

d.    Credentials(userid/Password)


       4.    Create a Sample script to verify the connection


Action{

char text[100];

strcpy(text,"Sample Message to be Send to TIBCO");

lr_output_message("%s text is ", text);

//sending message

jms_send_message_queue("Sending message",text, "QueueName");

return 0;

}

JMS Runtime Settings for Point-to-Point
JMS Runtime Settings

18 comments:

Anonymous said...

I tried to send JMS message to the ESB queue using jms_send_message_queue() method on web_service protocol in vugen.
For this, I made all the settings in vugrn runtime settings JMS-Advanced tab. When I run the script it throws following exception:
"com.sonicsw.mf.comm.ConnectTimeoutException: Timeout occured while attempting to connect"

Please send me the cause and solution for this exception.

Vamsi Tokala said...

Connection Timeouts can occur due to several reasons. it is better you work with the application team to understand the issue.

DIpak said...

Hello Vashmi,

Thanks for this information. Actaully I have some issues in getting the XML into the script. Some URLs are getting commented cause of // symbol. is there any way that we can get the message to VU gen scripts. And you also have mentioned that the que name is it mandatory ?

Vamsi Tokala said...

You have an option in LoadRunner to import soap request directly into the script. Yes Queue name is required to send messages

DIpak said...

Can you please send me a the sample script that you have created

Kumar said...

Hi Vamsi,

Do we need WSDL file to record or create a JMS_send_message_queue.All i have is 4 message xmls and an xsd. I need to put those messages in Queue for TIBCO load testing.I don't have any idea abt JMS scripts? can u pls explain me how it works and what i need in order to test the TIBCO.

kumar said...

Still waiting for ur response!!!!!!!Do we need JDK installed on our computer in order to test JMS???

Vamsi Tokala said...

Having JDK will always be useful. WSDL file is not required to create JMS scripte

Raj said...

Hi,

My LR script is doing well upto placing the message in the queue, but
jms_receive_message_queue is not executing and at this function only it is giving error message "JMSWMQ2008: Failed to open MQ queue".

So can you please let me know what are the possible reasons for this error and solution for it.

Vamsi Tokala said...

Its looks like connections settings may be incorrect.

Kumar said...

How do we script out JMS_send_queue_message using XML files? i have queue details and the sample XML messages..paeivid

Vamsi Tokala said...

Put the XML Format in the below function and use it to send messages

strcpy(text,"Sample Message to be Send to TIBCO");



lr_output_message("%s text is ", text);

Anonymous said...

Is it possible use loadrunner's webservices protocol for this situation -
SOAP with attachment (mime) over jms from TIBCO as resquest to siebel crm.

Vamsi Tokala said...

Yes, It is possible

Anonymous said...

Hi Vamsi...
I am creating a script using web services protocol and have an attachment to send with this script. I have created the script with wsdl n have tried attaching attachment using manage services - attachment option - mime, But the script fails. I could not find any details of mime envelope in the wsdl i got. could you please help me with this issue.

Anonymous said...

Hi Vamsi,

Many thanks for your solution.
I did the right settings of JMS Configuration as per your suggeston and I could successfully able to send the sample text message on JMS queues.

The next task is I have to send message in XML file format on queues and capture the response time for that message.

Could you please tell me what lr function should I write to send xml file message on queues ?

Regards,
SanJ

Ravi said...

Hi Vamsi, i tried to send SOAP over JMS using web services protocol. It is not tibco, but webspehere. I am geeting the below error, will you be able to help me understand if i am missing something. I configued the jars (sibc.jms, sibc.jndi, sibc.orb)in runtime settings.

Ravi said...

sorry missed to include the error

Error message : “Error: Failed to set property name JMS_MESSAGE_TYPE value TextMessage due to the following exception : javax.naming.NamingException: Failed to initialize the ORB [Root exception is java.lang.ClassCastException: com.sun.corba.se.impl.orb.ORBImpl cannot be cast to com.ibm.CORBA.iiop.ORB]”