Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Unable to Send JSON via apex.server.process call (Bad Gateway)

Joseph UpshawJun 19 2019 — edited Mar 30 2020

Application Express 18.2.0.00.12

We process some information from a front end form and turn it into JSON for a back end PL/SQL process. This has been working wonderfully for us until we hit what appears to be a size limitation.

From client side JS, we make the call into an application process named APPLY_RATES_FROM JSON. This takes three arguments, the name of the affected dataset (associatedDatasetName), the type of file that was the source for the generated JSON, (fileTypeName) and the JSON payload itself, (relevantCSVAsArrayofObjectsString). these are bound, respectively to x01, x02 and p_clob_1

apex.server.process( 'APPLY_RATES_FROM_JSON'

                                 , { x01: associatedDatasetName, x02: fileTypeName, p_clob_01: relevantCSVAsArrayofObjectsString } 

                                 , { dataType: "text",

                                     async: false,

                                     complete: function( ajaxResponse )

                                               {

                                                 fileProcessingResult = ajaxResponse.responseText;

                                               } 

                                  });

When the generated JSON (relevantCSVAsArrayofObjectsString) length is smaller, things work fine.

JSON Length: 314871

f?p=110:2:4468733513596:1401 Before AJAX Call

f?p=110:2:4468733513596:1411 After AJAX Call

f?p=110:2:4468733513596:1412 Changes Successfully Applied

However, then this exceeds some threshold, I haven't figured out what yet. we get this instead:

JSON Length: 1438750

f?p=110:2:4468733513596:1401 Before AJAX Call

desktop_all.min.js?v=18.2.0.00.12:4 Failed to load resource: the server responded with a status of 502 (Bad Gateway)

send @ desktop_all.min.js?v=18.2.0.00.12:4

f?p=110:2:4468733513596:1411 After AJAX Call

f?p=110:2:4468733513596:1412 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">

<html><head>

<title>502 Bad Gateway</title>

</head><body>

<h1>Bad Gateway</h1>

<p>The proxy server received an invalid

response from an upstream server.<br />

</p>

</body></html>

The invoked AJAX call simply pulls these values off of the apex_application variables and just passes them to a back end function:

DECLARE

lclb_CSVAsArrayofObjectsJSON CLOB;

   ls_FileProcessingResult      VARCHAR2(512);

   

BEGIN

    :DATASET_NAME            := apex_application.g_x01;

    :UPLOADED_FILE_TYPE_NAME := apex_application.g_x02;

   

    lclb_CSVAsArrayofObjectsJSON := apex_application.g_clob_01;

    ls_FileProcessingResult := APEX_SPAN_PARAMETER_MGR.APPLY_RATES_FROM_JSON( :DATASET_NAME,

                                                                              :UPLOADED_FILE_TYPE_NAME,

                                                                              lclb_CSVAsArrayofObjectsJSON );

    HTP.PRN(ls_FileProcessingResult);

END;

Does anyone know what limitation we're bumping up against and if it can be adjusted? This is a fairly small file.

This post has been answered by Joseph Upshaw on Jun 21 2019
Jump to Answer
Comments
Post Details
Added on Jun 19 2019
5 comments
1,782 views