NetTalk Central
NetTalk Web Server => Web Server - Ask For Help => Topic started 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
-
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
-
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
-
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
-
Thanks for the info. The content-type in my client POST call is 'application/json'.
Regards,
Mark
-
cool, keep an eye out for 7.12. I'm hoping to upload that tomorrow...