This topic provides tips for virtualizing JSON messages.

When virtualizing JSON messages:

  1. Set up virtual asset correlation (asset deployment settings): In the .pva’s HTTP settings, set a path that represents the common beginning part of the HTTP URL. For example, if all the requests for JSON content are expected to start with http://hostname/services/JsonServlet, then the HTTP path for the virtual asset containing the JSON Responders needs to be set to /services/JsonServlet. See Configuring Server and Deployment Settings for details.
  2. Create one or more Message Responders using one or more of the following methods—depending on whether you want the virtual asset to return different responses based on an HTTP URL path value or an HTTP URL parameter value.

    Creating Message Responders

    If you have a relatively small number of sample messages with relatively few different URL path parameter (or URL parameter) values to configure, and you wish to generate a “quick and dirty” PVA to replay the traffic, then use a Message Responder in Multiple Responses mode.

    If you have sample messages that have a similar structure, but many variations in element values, then use a Message Responder with Data Source correlation. See Data Source Correlation Tab for details.

    If you have REST traffic that has been recorded using a Message Proxy, create a Message Responder using the Traffic> Generate Parameterized Messages wizard described in Creating Parameterized Message Responders from Traffic.

  3. Configure the JSON content as described in Form JSON View Options.
  4. (Optional) Add a data source and parameterize as described in Parameterizing Tools with Data Source Values, Variables, and Extracted Values.
  • No labels