Hi All,
I am trying to store the field value of JSON response from the REST step which contains SOAP message using JSON path filter.The issue is the SOAP message is getting malformed with additional "\" getting added while we are storing in property like as shown below.
<soap:Envelopexmlns:soap="http://www.w3.org/2003/05/soap-envelope/"soap:encodingStyle="http://www.w3.org/2003/05/soap-encoding">
<soap:Body> <m:GetPriceResponse xmlns:m="https://www.w3schools.com/prices"> <m:Price>1.90<\/m:Price> <\/m:GetPriceResponse><\/soap:Body>
<\/soap:Envelope>
Thanks,
Vishwa
What version of DevTest are you seeing this issue? Can you send the expected response. I can try to reproduce the issue.
Hi,
Devtest 10.3 and expected is as shown below.
<soap:Body> <m:GetPriceResponse xmlns:m="https://www.w3schools.com/prices"> <m:Price>1.90</m:Price> </m:GetPriceResponse></soap:Body>
</soap:Envelope>
Json Xpath filter is used on Json responses. I don't think it works for Soap Response.
Web sites are available to check the validity of the JSON path expression. One example is https://jsonpath.curiousconcept.com/.
I have a JSON response as below
{"field1":"value1",
"field2":"<soap:Envelopexmlns:soap="http://www.w3.org/2003/05/soap-envelope/"soap:encodingStyle="http://www.w3.org/2003/05/soap-encoding">
</soap:Envelope>"}
The JSON response is not a valid JSON string - the " character is not escaped.
One option you have is to use the Create property based on surrounding values to save the content between "field2":" & "}
Please refer to https://docops.ca.com/devtest-solutions/10-3/en/reference/filter-descriptions/utility-filters/create-property-based-on-surrounding-values in case you need more information about the same.
Hi Prem_Bairoliya,
The JSON response that I am getting from actual application is a valid one may be the example I provided is a bad one and I will try the other option you mentioned above.
Regards,
LearnNow