We are in the process of migrating from Transaction server to PASOE.
This simple program works correctly using the Transaction server but does not work in PASOE with the OpenEdge.Web.CompatibilityHandler
USING Progress.Json.JsonParser from propath.
USING Progress.Json.ObjectModel.* from propath.
{ src/web/method/cgidefs.i {1}}
{ src/web/method/webutils.i {1}}
{&OUT} "Content-Type: application/json" http-newline http-newline.
def var demoObject as JsonObject.
demoObject = new JsonObject().
demoObject:Add("Tekst","Demo").
demoObject:WriteStream("WebStream",yes,"UTF-8").
What am i doing wrong ?
When you run this, what results are you seeing? Have you looked to see if there are any errors in the PASOE logs?
I get an empty page.
The message in the log file is:
17:40:07.777/60772 [thd-1] ERROR c.p.a.adapters.web.WebOutputStreamer - getStatusCode parsing blank error : streamState= ERROR
When i try to access the URL with wget: HTTP request sent, awaiting response... 500 2019-10-15 17:43:17 ERROR 500: (no description).
[View:/cfs-file/__key/communityserver-discussions-components-files/19/customwrapper.w:320:240]
The attached works fine for me.
I do not know what is failing. When i run the exact code (even the same .r) on my transaction server i get the JSON object. When i run it on PASOE, nothing. All pages that return HTML code work. It looks like a problem in sending JSON.
My sample from above is a CGI wrapper that successfully returns a JSON object to the WebStream on PASOE. I tried this on 11.7.5 right now. But I'm sure I did similar things on 12 already.
Thanks Peter. When i apply your suggestion it works. Leon.