Ask a Question

Error while writing Xpath expression for a json response in soapUI

roja1
Contributor

Error while writing Xpath expression for a json response in soapUI

Hi,

 

I have been trying to extract value from the json repsonse using Xpath in the property transfer step. I could do it using json path match but not Xpath. For some reasons I need to extract it using Xpath only. 

PFA for the json path match which is giving response. I have already tried this "/response/data[0]/number[0]/tNumber". Used Property as ResponseAsXml and Path languae as Xpath.

Please guide me on how to resolve this.

 

Thank you in advance

 

properresponse.PNG

 

1 REPLY 1
richie
Community Hero

Hey @roja,

You could try adding the 'Accept' header with value set as 'application/xml' to your request.

This will convert the response into xml, rather than relying on the responseAsXML convert?

Cheers,

Rich
if this helped answer the post, could you please mark it as 'solved'? Also if you consider whether the title of your post is relevant? Perhaps if the post is solved, it might make sense to update the Subject header field of the post to something more descriptive? This will help people when searching for problems. Ta
cancel
Showing results for 
Search instead for 
Did you mean: