Service Virtualization

  • 1.  Adding an argument and using it in request

    Posted Jul 13, 2018 04:19 AM

    Hello all,

    I have built successfully a virtual web service (REST POST Method) using a wadl file (Create VS image from WADL). The VS service was build with not arguments on it. When I add a new argument "arg1" and send a request including this argument the VS doesn't recognize my request and returns "The requested URL was not found on this server." error message.

     

    For information, the request I am sending is as below:

    {"arg1":"10"}

     

    Thank you in advance for the help.



  • 2.  Re: Adding an argument and using it in request
    Best Answer

    Posted Jul 13, 2018 09:16 AM

    Are you sending "arg1" as a query string parameter or in the body?

    If you are sending "arg1" in the body, did you include any other protocols (filters) in the VSM's Listen Step?  (e.g., JSON or XML DPHs)

    The REST DPH only processes the request URL including {URLPARAMs} and query string parameters..

    If "arg1" is in the body of the request, the JSON or XML DPH parse this value out and add it to the argument list.



  • 3.  Re: Adding an argument and using it in request

    Posted Jul 16, 2018 04:17 AM

    Thank you Joel, as you said, my problem was solved by adding JSON 2.0 on the request side.



  • 4.  Re: Adding an argument and using it in request

    Broadcom Employee
    Posted Jul 13, 2018 09:38 AM

    As your data looks JSON, adding JSON 2.0 DPH on the Request side should help you as Joel said.