Submit and vote on feature ideas.

Welcome to the new Parasoft forums! We hope you will enjoy the site and try out some of the new features, like sharing an idea you may have for one of our products or following a category.

JSON - Details from Body

lukeliwanag
lukeliwanag Posts: 36

Hi, I would like to extract some values from a JSON payload using JSON Databank. I was able to use a sample request and was able to extract Xpath with no errors. However when i send a request from SOA the same template used for JSON Databank i am getting an error.

Error message from Virtualize:
Test Name: 1. CreateDocument
Source: Convert JSON to XML
Message: Invalid JSON

below is the sample request i am sending. I am trying to extract "Signer1" under "signers"

{
    "signers" : [{
            "id" : "Signer1",
            "firstName" : "John",
            "lastName" : "Smith",
            "email" : "bank@email.com"
        }, {
            "id" : "client1",
            "firstName" : "Client",
            "lastName" : "Smith",
            "email" : "client.smith@email.com"
        }
    ],
    "documents" : [{
            "id" : "HealthForm",
            "name" : "Health Form",
            "index" : "1",
"reviewOnly" : "false"
        }, {
            "id" : "docB",
            "name" : "Document B",
            "index" : "2",
            "reviewOnly" : "true",
            "reviewerIds":["Signer1","client1"]
        }
    ],
    "authenticationTokenRequest" : {
        "signerId" : "Signer1"
    }
}
Tagged:

Comments

  • lukeliwanag
    lukeliwanag Posts: 36

    Please note we're using 9.10.1

  • keegan_chan
    keegan_chan Posts: 59 ✭✭

    Please use Traffic Viewer in SOAtest to make sure the request is what you expect. Also on Virtualize, make sure the JSON Data Bank on the responder is attached to Incoming Request.

  • OmarR
    OmarR Posts: 233 admin

    Hey Luke,

    What does your Responder currently look like? As @keegan_chan stated, please ensure that your databank is chained as the output for Incoming Request Payload.

  • lukeliwanag
    lukeliwanag Posts: 36

    Hi @OmarR and @keegan_chan yes it is similar.

    I went and double checked with our devs and it seems that the req sample they've provided is incorrect. The corrected one solved my issue.

    Thanks for both your response