Service Virtualization

Expand all | Collapse all

I am using devtest 10.1 ...I have a virtual service..,in that I have been trying to match a particular transaction with the incoming request based on a single argument by using a match script ..my issue is that the match script is not getting executed

  • 1.  I am using devtest 10.1 ...I have a virtual service..,in that I have been trying to match a particular transaction with the incoming request based on a single argument by using a match script ..my issue is that the match script is not getting executed

    Posted 11-28-2018 11:40 PM

    I am using devtest 10.1 ...I have a virtual service..,in that I have been trying to match a particular transaction with the incoming request based on a single argument by using a match script the transaction match style is set to exact ..my issue is that the match script is not getting executed and the vsi responds as if there is no match script at all....Can someone help me on this.



  • 2.  Re: I am using devtest 10.1 ...I have a virtual service..,in that I have been trying to match a particular transaction with the incoming request based on a single argument by using a match script ..my issue is that the match script is not getting executed

    Posted 11-29-2018 12:41 AM

    Can you share your match script? Often times the culprit to the issue is that there's an issue with the match script, such as a semantic error, and an exception is probably being thrown somewhere during the execution of your script and it exits prematurely without fully executing your script..



  • 3.  Re: I am using devtest 10.1 ...I have a virtual service..,in that I have been trying to match a particular transaction with the incoming request based on a single argument by using a match script ..my issue is that the match script is not getting executed

    Posted 11-29-2018 03:34 AM

    If your requirement is that for a specific operation (or for all operations) you only need one (1) argument to make a match then you can also use a Request Data Manager DPH to remove all unneeded arguments from your incoming request object. For this, you just have to add one "Keep" action in the RDM DPH. Now you can work in your Virtual Service Image with transactions that have a signature containing the operation and only that one argument.

     

    If the matching on the content of that argument is complex then a regex comparison operator should be able to handle that.

     

    Cheers,

    Danny



  • 4.  Re: I am using devtest 10.1 ...I have a virtual service..,in that I have been trying to match a particular transaction with the incoming request based on a single argument by using a match script ..my issue is that the match script is not getting executed

    Posted 11-29-2018 04:07 PM

    Kindly go through your match script once again it might be throwing an error. 

     

    Reference : Match Script Editor - DevTest Solutions - 8.0 - CA Technologies Documentation 

     

    If there is an error evaluating the script, VSE deliberately ignores the error and defaults to the regular matching logic. If you do not think your script is being run, review the VSE log file.

    A good way to add logging and tracing into your match scripts is to embed calls to the VSE matching logger. The VSE matching logger produces the messages in the vse_***.log file, where *** is the service image name. For example:

    import com.itko.lisa.VSE;

    VSE.info(testExec, "short msg", "a longer message");

    VSE.debug(testExec, "", "I got here\!\!");

    VSE.error(testExec, "Error\!", "Some unexpected condition"); 

    return defaultMatcher.matches(); 



  • 5.  Re: I am using devtest 10.1 ...I have a virtual service..,in that I have been trying to match a particular transaction with the incoming request based on a single argument by using a match script ..my issue is that the match script is not getting executed

    Posted 11-30-2018 02:14 PM

    HI William and Rahul 

     

    My Match script is similar to the one provided as the default sample match script in devtest 10.1(when you right click ). As per your suggestion I tested my VS then checked the vse.log file and got a an exception similar to this one

     

    javax.script.ScriptException: bsh.EvalError: Sourced file: inline evaluation of: 

     

    and then the first line itself of my script

     

     



  • 6.  Re: I am using devtest 10.1 ...I have a virtual service..,in that I have been trying to match a particular transaction with the incoming request based on a single argument by using a match script ..my issue is that the match script is not getting executed

    Posted 12-02-2018 11:17 PM

     That means there is something wrong in your script. You can debug the same . Since VSI will come into picture after VSM. Do one thing add a step "Execute script" in your VSM before VSI Response selection step and hit your service on local . Debug it step by step you will encounter exact error in "Execute script" .

     

    OR

    Share your script here .