Service Virtualization

  • 1.  Is there any way to edit request before it goes to Live invocation step?

    Posted Mar 14, 2018 04:33 AM

    Hi Team,

     

    I am working on a virtual service in which I need to add SOAP headers to the request before it goes towards Live System.However, I do not need SOAP Headers for my request towards virtual service.

    So I am looking for a way to edit request in the VSM so that it can be passed in the Live invocation step.

     

    Things I have tried till now are:

    1. Get request from lisa.vse.http.current.transation.body in Java Step and add SOAP headers (from string concatenation) and reset the lisa.vse.http.current.transation.body property.

    This doesn't work.

     

    Can someone please suggest how to achieve this.

     

    Thanks

    Sarthak



  • 2.  Re: Is there any way to edit request before it goes to Live invocation step?
    Best Answer

    Posted Mar 20, 2018 11:54 AM

    Process that you are following is correct the only change is, you should modify meta data in lisa vse request using method .getMetaData() instead of changing body.

     

    Hope that helps.

     

    Thanks,

    Monika 



  • 3.  Re: Is there any way to edit request before it goes to Live invocation step?

    Posted Mar 22, 2018 09:26 AM
      |   view attached

    Hi Monika,

     

    I have tried taking getMetaData() but I am not getting any information of the request.Also I am not sure how to extract and edit the request from here onwards.

     

    Please find below the code:

    import com.itko.lisa.vse.stateful.model.Request;

    import com.itko.util.ParameterList;

    Request req = (Request) testExec.getStateValue("lisa.vse.request");

    ParameterList args = req.getMetaData();

     

    I have also attached the current lisa.vse.request value in which I need to append SOAP Headers in the request.

     

    Thanks

    Sarthak

    Attachment(s)

    zip
    lisa.vse.request.txt.zip   1 KB 1 version