Service Virtualization

  • 1.  Wildcard matches in stateless transaction request

    Posted Oct 06, 2016 11:00 AM

    Given the following request:

     

    <apiRequest>    

       <policyReadOnly policyKind="Auto" policyNumber="0000000000">        

          <retrievePolicy/>      

       </policyReadOnly>

    </apiRequest>

     

    If I create a transaction and hard code in the argument match values for policyKind and policyNumber, the request matches successfully and the proper response is returned.  However, I am trying to change the match parameters so that it will match successfully on any policyNumber and then return that policyNumber as part of the response.  Here is how the version that works is setup currently:

     

     

     

    I've tried changing the match style, comparison operator, the value, and different combinations of each but nothing seems to work.  Is there some simple way to perform a wildcard match that I am overlooking?

     

    Thanks.



  • 2.  Re: Wildcard matches in stateless transaction request
    Best Answer

    Broadcom Employee
    Posted Oct 06, 2016 11:23 AM

    The comparison operator should be "anything" if you want to correlate against it but not have it cause a differently matched response. If your request happens to include any dates, you should see that these are automatically marked as "anything", so the virtual service doesn't fail if you run it tomorrow.

     

    If you want different responses for different groups of policy numbers, you want to select "regex" as the comparison operator, and match against different combinations of digits.



  • 3.  Re: Wildcard matches in stateless transaction request

    Posted Oct 06, 2016 12:17 PM

    So I tried that:

     

     

    And after submitting a request it just hangs indefinitely.  I finally cancelled the request after about 300s.  This is what I see in the log file corresponding the request:

     

    2016-10-06 16:10:03,443Z (12:10)[PolicyService-v1 [VS_PolicyService-v1_Run]/1] INFO - Inbound Request {"id":0,"operation":"apiRequest","arguments":{"policyReadOnly_retrievePolicy":"","apiRequest_policyReadOnly_policyNumber":"1234567890","apiRequest_policyReadOnly_productKind":"Auto","apiRequest_policyReadOnly_retrievePolicy":"<retrievePolicy/>"}}
    2016-10-06 16:10:03,443Z (12:10)[PolicyService-v1 [VS_PolicyService-v1_Run]/1] INFO - No Session ID No session identified
    2016-10-06 16:10:03,443Z (12:10)[PolicyService-v1 [VS_PolicyService-v1_Run]/1] INFO - Stateless Match Transaction: {"id":1006,"navigationTolerance":"<stateless>","request":{"id":1016,"matchTolerance":"SIGNATURE","operation":"apiRequest","arguments":{"policyReadOnly_retrievePolicy":"","apiRequest_policyReadOnly_policyNumber":"0000000000","apiRequest_policyReadOnly_productKind":"Auto","apiRequest_policyReadOnly_retrievePolicy":"<retrievePolicy/>"}}}
    2016-10-06 16:10:03,444Z (12:10)[PolicyService-v1 [VS_PolicyService-v1_Run]/1] INFO - Response Lookup Completed



  • 4.  Re: Wildcard matches in stateless transaction request

    Broadcom Employee
    Posted Oct 06, 2016 01:26 PM

    What is the think time spec for the response of transaction id 1006 in your VSI?

     

    Based on the log above, it looks like the transaction matching your request is different from what you have in your screenshot.



  • 5.  Re: Wildcard matches in stateless transaction request

    Posted Oct 06, 2016 01:58 PM

    Think Time Spec is 0.  If I am trying to match Anything for the policyNumber, should I remove the 0000000000 value and just leave it blank?



  • 6.  Re: Wildcard matches in stateless transaction request

    Posted Oct 06, 2016 02:19 PM

    So it does work now, but only about 30% of the time.  The other 60% it just hangs and never returns a response.