I need to create a service in Stand In mode, that if there isn't any EXACT match, it goes to the real service. The operation just have one parameter.
When I send a specific request it responds well, but if I send another parameter, the META is answering. Is there a way to META NOT answer?
I've run into this, too. The solution isn't baked into the product, but I wish it was.
My solution was to add metadata to the META transaction response. Something like "META=true". Then, I had a script look for the presence of this value in the metadata of the selected response. If it's there, go to Live Invocation. If it's missing, send back the virtualized response.
I have another idea that I haven't actually tried. If you try it, please report back if it works. How about a match script on the META transaction that just says "return false;"? I'm guessing it doesn't work, but give it a shot.
I talked with J_NeSmith and he sugested an assertion in the VSI Responder step.
var is_match = testExec.getStateObject
else return false;
This worked fine!
Clever. I never knew this way off determining if a response is a meta response.
Correction on the above -- I suggest adding the Assertion in the VSI Selection Step not Responder Step.
In fairness, I had never tried it and Francis decided to be my guinea pig.
The shortcut way that might do the same -- now that Francis has proved this out would be a simple
return ( testExec.getStateObject( "lisa.vse.matched.transaction" ) == null );
I normally use the approach of setting the META response and asserting on it in the VSI Selection Step.
Like you, Mike, I have never attempted a Match Script approach so unclear as to how that would work.
Another way is to add a specific "HTTP header" for the META response, for example HTTP-Response-Code = 404. Or any other value, and then check the "meta data" aka http headers for the given response and if it matches 404 or any other meaningful error code you've assigned then you know it's a META response.