# Verifying REST xml response

**URL:** <https://forum.katalon.com/t/verifying-rest-xml-response/9095>\
**Category:** API Testing\
**Tags:** api-testing, katalon-studio\
**Created:** [August 7, 2017, 5:26pm UTC](https://forum.katalon.com/t/verifying-rest-xml-response/9095 "2017-08-07T17:26:09Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Chris\_Smith](https://avatars.discourse-cdn.com/v4/letter/c/dbc845/32.png) [@Chris\_Smith](https://forum.katalon.com/u/Chris_Smith)\
**Post date:** [August 7, 2017, 5:26pm UTC](https://forum.katalon.com/t/verifying-rest-xml-response/9095/1 "2017-08-07T17:26:09Z")

</div>

Is that possible to verify xml response of REST service in katalon studio? If not can we convert xml response into json response and verify? Please give me some suggestions for the same. If possible, please share some piece of code.

---

<div class="post-metadata">

**Author:** ![Steve\_Smith](https://avatars.discourse-cdn.com/v4/letter/s/e19adc/32.png) [@Steve\_Smith](https://forum.katalon.com/u/Steve_Smith)\
**Post date:** [August 7, 2017, 5:26pm UTC](https://forum.katalon.com/t/verifying-rest-xml-response/9095/2 "2017-08-07T17:26:09Z")

</div>

Is that possible to verify xml response of REST service in katalon studio? If not can we convert xml response into json response and verify? Please give me some suggestions for the same. If possible, please share some piece of code.

---

<div class="post-metadata">

**Author:** ![Oliver\_Howard](https://avatars.discourse-cdn.com/v4/letter/o/22d042/32.png) [@Oliver\_Howard](https://forum.katalon.com/u/Oliver_Howard)\
**Post date:** [August 7, 2017, 8:58pm UTC](https://forum.katalon.com/t/verifying-rest-xml-response/9095/3 "2017-08-07T20:58:27Z")

</div>

Yes, you can. Please refer to the following steps:  
1. Download JSON jar from this page: [http://mvnrepository.com/artifact/org.json/json/20140107](http://mvnrepository.com/artifact/org.json/json/20140107)  
2. Import .jar file into your project: [https://docs.katalon.com/display/KD/External+Libraries](https://docs.katalon.com/display/KD/External+Libraries)  
3. Adjust your test case using conversion script to convert XML to JSON. Below is sample script where ‘xmlJSONObj.toString(textIndent)’ is the final result after conversion.

import static com.kms.katalon.core.testobject.ObjectRepository.findTestObject  
import org.json.JSONObject as JSONObject  
import org.json.XML as XML  
import com.kms.katalon.core.testobject.ResponseObject  
import com.kms.katalon.core.webservice.keyword.WSBuiltInKeywords as WS

ResponseObject response = WS.sendRequest(findTestObject(‘REST\_CommentDetails’))  
int textIndent = 2  
JSONObject xmlJSONObj = XML.toJSONObject(response.getResponseBodyContent())  
xmlJSONObj.toString(textIndent)

Thanks

\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_  
Thank you for choosing Katalon Studio as your automation solution.  
Your feedback is needed to make Katalon Studio a better tool, take the survey at: [https://goo.gl/S25NVO](https://goo.gl/S25NVO)

---

<div class="post-metadata">

**Author:** ![Chris\_Smith](https://avatars.discourse-cdn.com/v4/letter/c/dbc845/32.png) [@Chris\_Smith](https://forum.katalon.com/u/Chris_Smith)\
**Post date:** [August 8, 2017, 10:07am UTC](https://forum.katalon.com/t/verifying-rest-xml-response/9095/4 "2017-08-08T10:07:27Z")

</div>

Thanks for the quick response 🙂

---

<div class="post-metadata">

**Author:** ![Niranjan](https://avatars.discourse-cdn.com/v4/letter/n/e99b99/32.png) [@Niranjan](https://forum.katalon.com/u/Niranjan)\
**Post date:** [March 5, 2019, 4:56am UTC](https://forum.katalon.com/t/verifying-rest-xml-response/9095/5 "2019-03-05T04:56:29Z")

</div>

How can i extract json path of a particular node from the converted response in to order to use for VerifyElementPropertyValue.

---

<div class="post-metadata">

**Author:** ![nguyenlehoangquynh](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/nguyenlehoangquynh/32/20464_2.png) [@nguyenlehoangquynh](https://forum.katalon.com/u/nguyenlehoangquynh)\
**Post date:** [May 24, 2019, 6:41am UTC](https://forum.katalon.com/t/verifying-rest-xml-response/9095/6 "2019-05-24T06:41:31Z")

</div>

thank you so much.

---

<div class="post-metadata">

**Author:** ![albert.vu](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/albert.vu/32/20595_2.png) [@albert.vu](https://forum.katalon.com/u/albert.vu)\
**Post date:** [August 8, 2022, 7:48am UTC](https://forum.katalon.com/t/verifying-rest-xml-response/9095/7 "2022-08-08T07:48:49Z")

</div>


