NetTalk Central

NetTalk Web Server => Web Server - Ask For Help => Topic started by: markster on June 11, 2013, 10:47:05 AM

Title: SOAP/JSON
Post by: markster on June 11, 2013, 10:47:05 AM
I'm trying to integrate SOAP server functionality into my web app. Based on Example 42, I've set up a procedure for this and when I send a request from an outside program, the procedure is definitely called. However, I'm receiving JSON data. The listed options for the WebPage are HTML, PDF, Text, XML, and Other. Which do I specify and where is the incoming data stream being stored so I can get to it?

Thanks,

Mark
Title: Re: SOAP/JSON
Post by: Bruce on June 11, 2013, 09:31:29 PM
can you post an example of the incoming JSON data please?
I haven't written a JSON parser yet, but it's possible it's fairly simple in this case.

cheers
Bruce
Title: Re: SOAP/JSON
Post by: markster on June 12, 2013, 09:15:29 AM
All the POST/GET processing and JSON parsing procedures are already completed via a third party programmer working for me, so no need for that effort unless you want to add generic JSON functioning down the road. I understand it can be a bit tricky.

My problem is that I'm not receiving the data being POSTed. I put a STOP('') in the NetWebPage and it's stopping when I run the external app that's calling the POST URL, but where is the incoming data put/stored/whatever so I can access it to process and respond?

Regards,

Mark
Title: Re: SOAP/JSON
Post by: Bruce on June 12, 2013, 09:57:45 PM
short answer, (before 7.12)
the whole incoming post (including http header) is in p_web.requestData.DataString.
the length of the whole post is in p_web.RequestData.DataStringLen
the JSON part is after the first '<13,10,13,10>' in the string.

shorter answer, (7.12 and later)
the header is in p_web.GetValue('_postheader_')
the data part is in p_web.GetValue('_postdata_')

really short answer (7.12 and later)
if the content-type of the request is
application/json
then the json part will be in p_web.GetValue('_json_')

longer answer;
let me know what content type is being passed to you in the header. If it's suitable then I can make sure it gets added to the _json_ value as well.

cheers
Bruce

Title: Re: SOAP/JSON
Post by: markster on June 13, 2013, 07:17:49 AM
Thanks for the info. The content-type in my client POST call is 'application/json'.

Regards,

Mark
Title: Re: SOAP/JSON
Post by: Bruce on June 13, 2013, 07:23:50 AM
cool, keep an eye out for 7.12. I'm hoping to upload that tomorrow...