Service Virtualization

Expand all | Collapse all

Missing request arguments in image

Jump to Best Answer
  • 1.  Missing request arguments in image

    Posted 12-07-2016 03:39 PM

    Hi,

    I need an urgent help having access to request arguments in image. I am creating soap virtual service from req rsp pairs and when service is created, some of the elements are not getting captured under the “Arguments”.

     

    Please find below the section of the request which is not getting captured.

    My requirement is- I need to count the type which has value “ABC” and based on that number, I need to repeat certain tags in response.

    <accountListDetails>

    <account number="I1111111" type="ABC" />

    <account number="I2222222" type=" ABC " />

    <account number="I3333333" type=" ABC " />

    <account number="I4444444" type=" ABC " />

    </accountListDetails>

    When I create the service, rest other elements are captured as Argument but for-

     <account number="I1111111" type="ABC" />, it creates argument as “account_1” and nothing for “number” and “type”. It doesn’t’ create them as an argument so I am not able to access those in my match script.

     

    I tried with XML data protocol and to to add “number” and “type” as arguments, they get added with the full path name in request Argument list. But when I am trying to access those in match script by command, I am not getting any value returned.

    String number = incomingRequest.ge##tArguments().get("soapenv_Envelope_soapenv_Body_phwv_PwmPaymentValidationRequest_validationRequestDetail_accountList_account_1_number ");

     

    Can anyone suggest how I can achieve accessing “number” and “type” in my match script.

     

    Thanks,

    Ritu



  • 2.  Re: Missing request arguments in image
    Best Answer

    Posted 12-09-2016 05:18 PM

    Hi Ritu,

     

    In your XML "account" tag doesn't have any value but it has attributes "number" and "type", so by default VSE recorder is not going to create any arguments. To make attributes as arguments, you need to use "Request Data Manager" DPH or "Generic XML Payload Parser" DPH.

     

    Please refer the documentation "Request Data Manager" DPH and "Generic XML Payload Parser" DPH and see that helps with your issue. If you still need help please open a support ticket and one of the support engineer is going to contact you.

     

    Thanks,

    Prema



  • 3.  Re: Missing request arguments in image

    Posted 12-19-2016 01:24 PM

    You can Add Scripted Data Protocol while generating Virtual Service and write java code to generate new argument for your virtual service image.

     

    Regards,

    -Ankush Sharma