Check Web Gateway timeouts, specifically Server Response Timeout setting. Also Web Server can impose additional limitations.

That said, I'd advice you to move to async style of API, here's how.

Currently you have one call, say /GetData and it takes 10 minutes.

Split it into 2 calls:

  • /StartTask - JOBs a task (GetData) and returns GUID (child pid in the most simple case)
  • /GetTask/:GUID - returns current JOB status and if it's done returns the data

Here's a sample ASYNC REST broker.

This will save you a lot of problems down the line.

Note that instead of:

do ##class(isc.py.util.Shell).Shell()

Python Shell can be entered by simply typing

zpy

In there you can just directly type python code:

exec(open('disk:/path/to/your/folder/testfile.py').read())

Or don't open the shell and call:

set sc=##class(isc.py.Main).SimpleString("exec(open('disk:/path/to/your/folder/testfile.py').read())",,,.sc)

1. Underscored properties are extracted. Get them by quoting property name (case is important too):

set centro.codCias = objeto.GetAt(i)."cod_cias"

2. You don't need to init json provider as you're calling a classmethod, replace:

set claseAux = ##class(%ZEN.Auxiliary.jsonProvider).%New()
set tSC= claseAux.%ConvertJSONToObject(.linea,"EsquemasDatos.miSCS.GestionFavoritos.tns.infoCentro",.objeto,1)

with:

set tSC= ##class(%ZEN.Auxiliary.jsonProvider).%ConvertJSONToObject(.linea,"EsquemasDatos.miSCS.GestionFavoritos.tns.infoCentro",.objeto,1)

or even better:


set class = ##class(EsquemasDatos.miSCS.GestionFavoritos.tns.infoCentro).%ClassName(1)
set tSC= ##class(%ZEN.Auxiliary.jsonProvider).%ConvertJSONToObject(.linea,class,.objeto,1)

3. Iterators for JSON. Recommended approach is upgrading to 2016.2+ as  it contains way better json handling (dynamic objects) with iterators.

For %ZEN.proxy object you can call %CopyToArray and iterate over it.

set tSC = ##class(%ZEN.Auxiliary.jsonProvider).%ConvertJSONToObject("{""prop_a"":1,""prop_b"":2}",,.obj)
do obj.%CopyToArray(.array)
for {
    set key=$order(array(key),1,val)
    quit:key=""
    write key," = ",val,!
}

4. Iterators for classes. Use a method generator to write the code iterating over properties. Relevant discussion.