Tuesday, October 11, 2011

Using LoadRunner to capture SOAP requests generated using soapUI application

Problem:
How to capture soapUI request(s) in LoadRunner.

Assumption:
1: A SOAP request has already been created in soapUI. I am using Metric Weight Unit Convertor WSDL from webserviceX for this problem.

Solution:
1: Select an Web HTTP/HTML protocol in LoadRunner.

2: In Start Recording window, input the following options:
Application type: Win32 Applications
Program to record: "...\HP\LoadRunner\bin\micexec.exe" -->micexec.exe path
Program arguments: "...\soapUI-4.0.0.exe" -->soapUI path

3: Click OK button. This launches the soapUI application.

4: Run the SOAP request in soapUI. You will notice that LoadRunner is now capturing the soapUI traffic.

5: Stop the LoadRunner recording, once soapUI has finished submitting the request. You will notice that the same request created in soapUI has been captured in LoadRunner.

6: Replay the script in the LoadRunner and you will notice that the correct response is returned.

NOTE:
You might get "The JVM could not be started. The maximum heap size (-Xmx) might be too large or an antivirus or firewall tool could block the execution" error message.

You can fix this issue by updating the -Xmx value in the soapUI-4.0.0.vmoptions file. Reduce the size JVM Xmx value. In my case, I reduced it from 1200 to 512. This fixed the issue and I was able to record the script. You might also get OutOfMemory issue when launching soapUI using LoadRunner. This is because the maximum heap size set in soapUI is less than the memory required by soapUI to successfully launch. Increase the heap size to what the soapUI application requires or remove the unnecessary projects.

23 comments:

Ezhil Arasu said...

I am getting Memory could not be read error after the first step. Can you please help me

Harinder Seera said...

So you are getting memory read error message after you "1: Select an Web HTTP/HTML protocol in LoadRunner."?

Unknown said...

Hi Harinder,
Thank You for sharing such valuable information. I was trying to record SoapUi through loadrunner but in spite of entering the paths that you mentioned soapui does not open when i click ok to record. I am using vugen to do my scripting and therfore have modified the paths but cannot figure out the problem. Can you suggest what mind be the problem?
Thanks

Harinder Seera said...

What version of soapUI are using? Also is it 64bit or 32bit soapUI application? You will need to use 32bit soapUI application with Vugen.

Unknown said...

Hi Harinder,
Thank you for your reply. I am using SoapUI version 4.0.1. I will have to check it if its 32 bit or 64 bit and will give it one more try. Also, I had one more question for you. i was trying to run the sample request (which gives me a valid response in SoapUI) but the response in LR shows that it has rejected the same request when i run it through web services protocol saying some arguments are missing. Also, i tried to run this xml using web_custom_request as i have done with other services but it gives me the Error -27226: The "" argument (number 8) is unrecognized or misplaced. I have tried some variations with it and given the request the name as it shows in SoapUI but not able to get rid of this error. Is there any solution to this problem?
Appreciate your help!!
Thanks

Harinder Seera said...

Hi Rahul,

Please have a closer look at your scripts if LR is saying that you are missing some arguments. I can't help you without having a look at your scripts.

If you are having trouble invoking soapUI through LoadRunner, you could also use network tools like Wireshark to capture soapUI traffic. Then use it to construct loadrunner web_custom_request with correct headers and body.

Unknown said...

Thanks for your help Harinder!! I got it to work using web services and fixing the arguments. Also, I appreciate the information you have been sharing with us it is indeed very helpful for every performance engineer.

Unknown said...

Hi Harinder,
I am unable to find micexec.exe inside the HP folder. I don't have a folder called LoadRunner, the only folders that I have are Analysis, Vugen,Common and HP Software Update. Which version of Loadrunner do we need to use?

Harinder Seera said...

1: Have you looked under ...>HP> Virtual User Generator > bin.

2: Also, you could have used Windows(that is if you are using Windows OS) search to search for micexec.exe application.

Loadrunner said...

Hi Harinder,

While recording soapUI Pro 4.5.1, I am getting "the application has encountered a problem and needs to close" message is displaying.

I have tried with "Notepad.exe" also. But the same result. Please guide me.

Thanks ahead.

Harinder Seera said...

Hi There,

There isn't much information for me to really help you. What kind of investigation have you done on your own?

For example,
1: Does SoapUI crashes on its own?
2: Are you using 32bit or 64bit SoapUI application?
3: Have you looked at the memory footprint when you are invoking SoapUI through Loadrunner?
4: What is the max heap size for the SoapUI JVM and how much memory do you have on your machine?
5: Are you using loadrunner micexec.exe application to invoke SoapUI?
6: What version of Loadrunner are you using(9.5/11/11.5)?
7: Does the free version of SoapUI also crashes? (Assuming you have licensed SoapUI Pro)

voodoo said...

Thanks for the great post. It worked for me and saved me a lot of time!

Unknown said...

Reaaly a Great Post. I am getting Error in Loadrunner saying "Missing Supporting Tokens". I tried using Web_set_user to pass username id and password for the WSDl request. But seems like nothing is working.

Can you please share some tips to get rid of this problem.

Harinder Seera said...

@Tarandeep, From your message it looks to me, your issue might be related to WS security policy. Have you read "WS-SecurityPolicy" and how it works?

http://specs.xmlsoap.org/ws/2005/07/securitypolicy/ws-securitypolicy.pdf

Unknown said...

Hi Harinder,

Could you please let me know where to find VM OPTION file in Soap UI as I am getting JVM issue.
Thanks

Unknown said...

Hi Harinder,

Could you please let em know where to find VM Option file in SOPA UI folder as aI am getting JVM issue.
Thanks

Unknown said...

Hi Harinder,

I found the file but after changing the value, m getting Access Denied while saving it.
Thanks

Harinder Seera said...

Do you have admin access to update the file?

Unknown said...

Hi Harminder,

It workded for me. Thanks a lot for this post.
Thanks

Unknown said...

Hi Harinder,

Could you plese let me know WHY we select msiexec.exe and what does it do.
Thanks

Vidhya said...

Hi..this was working fine until I upgraded my PC to Windows 7. Soap UI does not get initiated or opened up when I try to record?Any suggestions pls?

Aroorajith said...

Excellent, Blog.. helped us alot !

Unknown said...

Great tip! It solved a problem which had cost me days of struggle.