Question
· Jan 26, 2017

SOAP.OutboundAdapter HttpResponse doesn't handle large response [SOLVED]

Hi all,

Sorry to bother frown

I have a Business Object with SOAP.OutboundAdapter and it gets the response from a WebApi.

Following the sample Creating REST Services and Clients with Ensemble - Developing a REST Operation, I've done the call and it retrieves a JSon with the information. The result is a JSon with a Base64 content (at least 15000 bytes)

I've put a trace to check the content  with $$$TRACE(tHttpResponse.Data.Read() I have a cut result (to 1200 character), so the JSonStreamToObject is not able to allocate the full result into a object.

is there any way to handle more character in HttpResponse or is about SOAP.OutboundAdapter configuration?

Best regards

Discussion (6)0
Log in or sign up to continue

Hi all,

I've found the "ghost in the code". The problem was the JSon structure has some fields with "_" as part of the name of the property. When it tries to convert JSon to a class, this kind of name is not good for ensemble.

How have I solved? easy... replacing the content and remove all "_" (I'm sure that there is not values with "_")

    set content = tHttpResponse.Data.Read()
    $$$TRACE(content)
    $$$TRACE($LENGTH(content))
    
    set content = $REPLACE(content,"_","") // Remove all _ as part of the field name
    
    set objJson = ##class(%DynamicObject).%FromJSON(content)

    set b64 = objJson.Result.RES.DATA.DATAB64   // Instead of DATA_B64

Take care with this problem if you are developing Api and Cache wink

Best regards