Software Archive
Read-only legacy content
17061 Discussions

Consuming the response from a web service call

Richard_Siena
Beginner
519 Views

 

I am executing the following web service call

 intel.xdk.services.PartnerPRMLogin({"UserName":un,"Password":pw,"DNSPrefix":dns}).then(function (response) {
          x.innerHTML= x.innerHTML + "at one<br/>";
          var XMLString = JSON.stringify(response, null, 2);
          x.innerHTML= x.innerHTML + XMLString; 

 });

How do you change the response to a form that you can identify the data elements?

thanks,

Rich

    

0 Kudos
2 Replies
Elroy_A_Intel
Employee
519 Views

There isn't a standard convention for converting JSON data to form. According to the W3C Working Draft, form data can be convert to JSON data.

0 Kudos
Richard_Siena
Beginner
519 Views

Elroy,

Thanks for the response

Why not just return the raw XML then?

It seems a wast to convert the XML to JSON text only to have to write code to convert it to a usable format when there are calls to parse the XML into a usable form already in the library? Not sure I understand the logic here.

It appears that if I use the designer without code then I can access the xml fields correctly with no code. 

Is there a way to access the returned fields so I can reference them programmatically without having to write a parser of sorts to get the field data?

It seems like there should be a way.

Thanks

Rich

0 Kudos
Reply