web_service_set_security Action Mismatch error
Just a quick heads up if you are having issues when using the web_services_set_security function in LoadRunner. The web_service_set_security function is used to add security tokens to subsequent soap and web service calls. When replaying one of my web service scripts that use the web_services_security function I keep getting an “Action Mismatch” error.
The script is using the web_services_set_security to create a message signature. But LoadRunner is sending the whole message with a Time Stamp, Body and Header. This behavior is killing my application service because it only expects to receive the Body to be signed — not the whole message. Because of this behavior I keep getting a LR “Action Mismatch” error. After looking around in HP KB I found out this issue is a known product defect.
How to Resolve
- First grab the file DeleteSoapHeaders.zip from my download section.
- Copy the DeleteSoapHeaders.dll to your Load Runners’s bin folder
- Next to configure the deleting headers choose either Method 1 Script Level or Method 2 Step Level below.
Method 1 Script Level
Making this change will send all the WSC’s in the script without any header in the soap envelope.
- Navigate to your LoadRunner script’s directory and open the default.cfg file with a file editor like Notepad or Notepad++
- Add a section called UserHandler to the very end of the default file. The exact section to copy is:
[UserHandler] Name=LrWsSoapFilterLoader Args=<Filters OutputFilterClass="DeleteSoapHeaders.OutputFilter" OutputFilterLib="DeleteSoapHeaders" /> Order=AfterSecurity
- Save the file and run your script. The
Method 2 Step Level
Making this change will only be applied to a specific step.
- Add the step that you want to send without the headers to the script
- Add the following lines of code to your step right before the BEGIN_ARGUMENTS element:
"UserHandlerName=LrWsSoapFilterLoader", "UserHandlerArgs=<Filters OutputFilterClass=\"DeleteSoapHeaders.OutputFilter\" OutputFilterLib=\"DeleteSoapHeaders\" />", "UserHandlerOrder=AfterSecurity",
That should work
Let it rip – you should be good to go now. Hope it helps you.