I am facing issue in converting json response in a required format. Request:
{
"firstName": "ABC",
"middleName": "V",
"AddrCity": "CITY",
"AddressLine2": "ADDRESS LINE 2",
"LastName": "LASTNAME",
"AddressLine1": "ADDR LINE1",
"Country": "India",
"customerId": "1234",
"AddrPinCode": "999999"
}
Below is the response i am getting Response:
{"return":
{
"response": [{"$": 1234}],
"responseMessage": [{"$": "Success ABC"}],
"responseCode": [{"$": "CITY,India"}]
}
}
Notice the "$" symbol, which is giving problem while fetching the response. Below is the expected response and also need to fetch response, responseMessage & responseCode values accordingly
{"return":
{
"response": 1234,
"responseMessage": "Success ABC",
"responseCode": "CITY,India"
}
}
Thanks for your quick response in advance.
response.return[keyName][0]['$']beingresponsethe parsed object andkeyNamethe property you want to access.