LoadRunner – web_service_set_security Action Mismatch error

PerfectoTopAd

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.

Cause

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
    element should no longer appear in the soap envelope.

 

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.

16 comments
Haritha - March 1, 2012

Hi,
This is a very helpful website. Can you help in how to script the Soap request which is parsing the data in CDATA? Load Runner is not recognizing the CDATA part.
EX: <![CDATA[

Reply
    Joe Colantonio - March 2, 2012

    Haritha » Thanks Haritha – this is happening when you send a request or when your trying to extract data from a response> Can you send me the full request/response?

    Reply
      ayan - January 23, 2013

      I am having the same issue did we get a solution

      Reply
        kumar - January 29, 2013

        I’m running into the same issue, can you provide us a solution for this.

        Reply
Suman - April 16, 2012

Hi,

Can u help in scripting using wsdl ?

Reply
    Joe Colantonio - April 16, 2012

    Suman » Hi Suman – I’m not sure I would need more info. Are you getting this error? What are you trying to do?

    Reply
EPT - May 14, 2012

Hi !
I’m getting an error message when replying my script after certificate is added. The thing is that certificate “ID VALUE” contains an ampersand ( & ) character. Could this be causing the issue, how can I fix this?

xxx.c(35): Error: InvokeMethod failure: An error occurred while parsing EntityName. Line 1, position 148..
xxx.c(35): Error: ExtractResultArg failure: Object reference not set to an instance of an object..
xxx.c(35): Error: Web service call “xxx” execution failed

Reply
    Joe Colantonio - May 16, 2012

    EPT » Not sure — do you get more info when you run with extended logs turned on?

    Reply
rahul - November 11, 2012

Hey Joe,
Thanks for sharing this invaluable information with us..it is indeed really helpful. I am currently running a web service script but keep getting the HTTP 401 error. I turned on the extended logs and it shows an invalid session or session ID expired. My question is that how should i fix this issue as there are no cookies involved and i have tried the web_set_user and web_set_security function but nothing seems to be working. Thanks for your help,

Reply
    Joe Colantonio - November 12, 2012

    rahul » Hi Rahul –does trying either of the following help:
    1. Check Run-Time Settings–>Internet Protocol–>Preferences–>WinInet Replay instead of Socket (Windows Only).
    The WinINet functions support server and proxy authentication for http sessions.
    2.  Go to:
    – Run-Time Settings–>Internet Protocol–>Preferences–>Options.
    – Under “Authentication” section, change “Enable Integrated Authentication” to “Yes”.
    In this case, LoadRunner will use the username and password of the machine’s user to authenticate the session. 

    Reply
Smith - December 10, 2012

Hi Joe,
i get below Notification when i run my script in Loadrunner. i want to get data on output window when i run script.
can you help me out? thanks

Action.c(2): Notify: Saving Parameter “GetYears_101_Response = False350Machine: COAURWEB54. Object reference not set to an instance of an object.”.
Action.c(2): Notify: Saving Parameter “response = false350Machine: COAURWEB54. Object reference not set to an instance of an object.”.

Reply
Dnyan - October 7, 2013

Hi Joe,
Good Morning.
I am scripting Web services for the first time. I have imported the WSDL, I have parameterized the input in the request. When I execute the script I am getting below error. Could you please guide me what to do in this case.

Action.c(6): Error:InvokeMethod failure: Could not resolve address of host usbdsblweb941.global.baxter.com.
Action.c(6): Error:ExtractResultArg failure: Object reference not set to an instance of an object..
Action.c(6): Error:Web service call “CallBAXAssetMaster_101” execution failed.

Looking forward for your help.

Reply
    Joe Colantonio - October 31, 2013

    Hi are you able to bring up the WSDL in a browser with out using any tool? Is the WSDL from a live system or are you using a local copy of it?
    It is always recommended to consume the WSDL from a live system (in any environment) but otherwise it is important to copy all dependent files and edit the WSDL (and files) to resolve references.“

    Reply
Sravya - October 11, 2013

Hi Joe,
from where can i download the below mentioned file.
I am encountring error as “Error:ExtractResultArg failure: Object reference not set to an instance of an object” while doing a webservice scripting using a WSDL Url
First grab the file DeleteSoapHeaders.zip from my download section

Reply
Click here to add a comment

Leave a comment: