PDA

View Full Version : Error message when send a JSON greater than 520000



Dominciano
6-Mar-2019, 01:49 PM
I've created a RESTFUL API using the following link:


https://www.unicorninterglobal.com/Company-White-Papers-Creating-RESTful-JSON-Web-Services-in-DataFlex-868




When I try to send a JSON with greater than 520000 characters, the following errors occur.


At Client Side

12626

At Server Side

12627
12628
12629

At Debugger
12630



I tried the POSTMAN program.
I used the HttpPostRequest / HttpPostAddrRequest function
I increased the maximum limit of the variables size and the error remained

In all the cases, the error still remains.

PS: Sorry for my bad English.

starzen
6-Mar-2019, 01:55 PM
i would guess your issue is with the argument_size which limits string sizes

Dominciano
6-Mar-2019, 02:09 PM
i would guess your issue is with the argument_size which limits string sizes
Thanks for the answer, but I set the argument_size to 6144000.

starzen
6-Mar-2019, 02:29 PM
where are you setting it. It may be too late

i have not used DAWs rest stuff as there are too many limits with it so i am not sure if this will work at all but i would think it should

you need to set the argument size as early as possible. Any code executing that processes your data has to have it set

so to test i would set it way at the beginning of the program before anything else.

Dominciano
6-Mar-2019, 03:58 PM
where are you setting it. It may be too late

i have not used DAWs rest stuff as there are too many limits with it so i am not sure if this will work at all but i would think it should

you need to set the argument size as early as possible. Any code executing that processes your data has to have it set

so to test i would set it way at the beginning of the program before anything else.

I set it inside the procedure 'Construct_Object' of 'cRESTfulService' class.

I also tried to set it inside of every procedure in 'cRESTfulService' class.

The error still remains.

I think the issue is in 'REST.asp' archive or maybe in IIS, because the error only occurs in the last line of 'ReturnJson' Procedure.

REST.asp
<%

Dim sData, iLen

iLen = Request.TotalBytes

If (iLen > 0) Then sData = oExamesWS.UTF8ToString(Request.BinaryRead(iLen))

Response.BinaryWrite oExamesWS.StringToUTF8 (oExamesWS.call("GET_ProcessCall", sData, iLen))

%>

Mike Peat
8-Mar-2019, 03:57 AM
Hi Dominicano

Two things...

1. This way of creating RESTful web services was really a short-term work-around - the 19.1 version (now at the Release Candidate stage) provides much better facilities for doing this. If at all possible, I'd switch to that (no more ASP - just pure DataFlex).

2. Could you post some of your DataFlex code here? Not the business functionality, but the working guts of your cRESTfulService object. Use the code tags to make it readable (there is an icon for it if you click "Go Advanced" below).

Mike (I wrote the article)