Service Virtualization

  • 1.  Trying to add argument to Raw Soap Request

    Posted Jan 18, 2017 02:49 PM

    I've added a Raw SOAP Request step in my model.  I'm trying to set an input node in it to a value from the Request Data arguments.  However, everything I try comes up with not found.

     For example-

    {{=request_selectedAccount_number}}

     

    comes back in response as-

    Account number requestselectedAccountnumber not found

     

    I've tried some other options with no luck.

     

    DevTest 8.5

     

    Wondering if anyone has any tips for that?

     

    Thanks!

    Gary



  • 2.  Re: Trying to add argument to Raw Soap Request

    Broadcom Employee
    Posted Jan 18, 2017 05:18 PM

    The {{=request_selectedAccount_number}} argument notation is in the VSI. If you want to add argument value in the Raw Soap request step, you can create a filter on that in the Listen step first. Then use the filter name as {{filtername}} in the Raw SOAP Request step.



  • 3.  Re: Trying to add argument to Raw Soap Request

    Posted Jan 18, 2017 05:44 PM

    Thanks!  I've tried that a bit as well but have been unsuccessful.  

     

    Variations-

    lisa_vse_request.getArguments("selectedAccount_number");

    testExec.setStateValue("newAcctNumber",lisa_vse_request.getArguments("selectedAccount_number"));

    testExec.setStateValue("newAcctNumber",lisa_vse_request.getArguments().get("selectedAccount_number")",));

    testExec.setStateValue("newAcctNumber",args.get("selectedAccount_number"));

     

    I'm not sure how to get the account number from the Listen step.  

     

    then using {{newAcctNumber}} in the Raw SOAP request step

     

    Should one of those or another option work?

     

    Thanks!



  • 4.  Re: Trying to add argument to Raw Soap Request
    Best Answer

    Broadcom Employee
    Posted Jan 19, 2017 01:30 PM

    This is how you can create filter in the Listen step.

    . Run the VSM in ITR and send a transaction.

    . Once the transaction ran completely, click on the "Properties" tab in ITR.

    . In the Properties tab, look for an arrow at the bottom of the tab (it will be some where in the middle) and click on it. Which will open "Export Properties" window.

    . In "Export Properties" window, click on "Select all" and then click on"Export". This way all your properties are available to the VSM and you can create filter/assertion in any of the VSM steps.

    . Now go to your VSM--> Listen step and try creating a filter. If your request is in XML then you can add XML-->XML Xpath filter if not use different filters. By default, "Filter In field" has lisa.stepname.rsp property. Look at your ITR and see which property has your request. If it is a soap request then it will be in "lisa.vse.http.current.transaction.body". Use this property in the XMLXpath filter-->Filter In field and press tab which will show your request.

    . Once you see the request, look for the argument value you are looking and select it which will automatically add Xpath in the "Xpath Query" field.

    . Add a name to this filter in the "Save to property" field. This property will have your argument value. You can click on "Run filter" on the top right corner and you should see the value in "Filter run results".

    . After the above steps are followed, you add the above filter name in your Raw soap request step and that should have the argument value you are looking.

     

    If you still need help, open a support ticket and I will do a WebEx and help you with the issue..



  • 5.  Re: Trying to add argument to Raw Soap Request

    Posted Jan 19, 2017 01:59 PM

    Ok- that did the trick!  Thanks so much!

    Gary



  • 6.  Re: Trying to add argument to Raw Soap Request

    Posted Jan 19, 2017 12:01 AM

    lisa_vse_request.getArguments() gives you argument list. you need to use getParameterValue() method to retrieve a particular argument.

    lisa_vse_request.getArguments().getParameterValue("selectedAccount_number");



  • 7.  Re: Trying to add argument to Raw Soap Request

    Posted Jan 19, 2017 08:53 AM

    Gary,

     

    Did Prema's and Syed's recommendations resolve your issue?



  • 8.  Re: Trying to add argument to Raw Soap Request

    Posted Jan 19, 2017 11:39 AM

    Well I'm not sure.  After I run the ITR I'm not seeing the new parameter on the Properties tab and the value isn't replaced in the raw soap request. So I'm still doing something wrong.  

    If I create a Scriptable data protocol which spot would I put the getParameterValue in?  Is it the Process Requests/Request tab or Process Response Response-Playback tab?

     

    testExec.setStateValue("newAcctNumber",lisa_vse_request.getArguments().getParameterValue("selectedAccount_number"));

    Thanks!