Service Virtualization

 View Only
  • 1.  How to Fetch Value from Response Header when using REST Step ( LISA 7.5.1)

    Posted Apr 11, 2016 08:57 PM

    Hi All,

     

    I have a requirement in which I need to fetch the value of one of the headers coming in the Response of the REST Step and pass that value in the Request Header of another REST call. There is no filter which allows us to take value of header and the scriptable data protocol filter which allow us to do this works only in VSM but not in test case.

     

    Can you please let me know how to do this??

     

    Regards,

    Vinit Malhotra



  • 2.  Re: How to Fetch Value from Response Header when using REST Step ( LISA 7.5.1)
    Best Answer

    Posted Apr 12, 2016 06:36 PM

    Hi Vinit,

     

    There should be a property called "lisa.REST Step.http.headers" where "REST Step" is the name of your test step which should contain the headers.  The type of the object contained in this property is a com.itko.util.ParameterList.  Here is a sample script that would allow you to get one of the values:

     

    import com.itko.util.ParameterList;

    import com.itko.util.Parameter;

     

    ParameterList list = testExec.getStateObject("lisa.REST Step.http.headers");

    Parameter p = list.get(0);

    return p.getValue();

     

     

    Josh



  • 3.  Re: How to Fetch Value from Response Header when using REST Step ( LISA 7.5.1)

    Posted Apr 12, 2016 07:08 PM

    Hi Josh,

     

    Yeah I too was able to see that later in the evening .. Thanks for your response. Much appreciated!!