[XML Records] Parser

Forge Component
(44)
Published on 2019-11-25 by Afonso Carvalho
44 votes
Published on 2019-11-25 by Afonso Carvalho

Hello i'm new in Outsystems. I have JSON web service which give me response in xml and in Outsystems i got response in text format. Now i want to parse it. How can i achieve it.Please explain me 

Hi Maha,

I think you will be able to receive data in json format if you add "Accept" in your header with the value of "application/json".

The idea came from this post.

https://www.outsystems.com/forums/discussion/20155/consume-rest-api-xml/


Regards.

Clifford Deapera wrote:

Hi Maha,

I think you will be able to receive data in json format if you add "Accept" in your header with the value of "application/json".

The idea came from this post.

https://www.outsystems.com/forums/discussion/20155/consume-rest-api-xml/


Regards.

Are you pointing on that. Screenshot are attached


Maha Rani wrote:

Clifford Deapera wrote:

Hi Maha,

I think you will be able to receive data in json format if you add "Accept" in your header with the value of "application/json".

The idea came from this post.

https://www.outsystems.com/forums/discussion/20155/consume-rest-api-xml/


Regards.

Are you pointing on that. Screenshot are attached


I'm actually pointing on to your REST API Method. 

1. Open your method 

2. then go to the "Headers / Auth" tab

3.  from there you click on to the dropdown box under the Request Headers

4. choose "Accept"

5. go to the "Test" tab

6. you will see there that "Accept" is added to the Header values

7. put "application/json" in the inputbox

8. click the "TEST" button to try if the response will be in json.

Hope this help.

Clifford Deapera wrote:

Maha Rani wrote:

Clifford Deapera wrote:

Hi Maha,

I think you will be able to receive data in json format if you add "Accept" in your header with the value of "application/json".

The idea came from this post.

https://www.outsystems.com/forums/discussion/20155/consume-rest-api-xml/


Regards.

Are you pointing on that. Screenshot are attached


I'm actually pointing on to your REST API Method. 

1. Open your method 

2. then go to the "Headers / Auth" tab

3.  from there you click on to the dropdown box under the Request Headers

4. choose "Accept"

5. go to the "Test" tab

6. you will see there that "Accept" is added to the Header values

7. put "application/json" in the inputbox

8. click the "TEST" button to try if the response will be in json.

Hope this help.


Thanks but the response is in xml form.