[Progress Communities] [Progress OpenEdge ABL] Forum Post: RE: HTTP client (OpenEdge.Net.pl) response body issues on Linux

Status
Not open for further replies.
I

ihuzjak

Guest
Dear Peter, thank you for your answer. No, didn't get any log errors, my log-manager log file looks like this: [OE.N.HTTP.L.ABLS.ABLSocketLibrary INFO] REQUEST: TIMEOUT(s)=0 [OE.N.HTTP.L.ABLS.ABLSocketLibrary DEBUG] REQUEST: FILE= /srv/medical/db/request-raw.txt [OE.N.HTTP.L.ABLS.ABLSocketLibrary DEBUG] RESPONSE: FILE= /srv/medical/db/response-data-received.txt [OE.N.SC.ClientSocket DEBUG] Connect: -H hr-nbs-ite-domname.northeurope.cloudapp.azure.com -S 80 [OE.N.SC.ClientSocket DEBUG] Connect: TIME(ms)=46 [OE.N.SC.ClientSocket DEBUG] Write: time(ms)=0 [OE.N.SC.ClientSocket DEBUG] Write: size(b)=1211 [OE.N.SC.ClientSocket DEBUG] WaitSync: timeout(s)=0 [OE.N.SC.ClientSocket DEBUG] ReadHandler: OK? yes [OE.N.SC.ClientSocket DEBUG] ReadHandler: time(ms)=133 [OE.N.SC.ClientSocket DEBUG] ReadHandler: size(b)=488 [OE.N.HTTP.L.ABLS.ABLSocketLibrary DEBUG] CHUNK: NUM= 1 [OE.N.HTTP.L.ABLS.ABLSocketLibrary DEBUG] CHUNK: SIZE(b)= 8192 [OE.N.HTTP.L.ABLS.ABLSocketLibrary DEBUG] CHUNK: READ(b)= 488 [OE.N.HTTP.L.ABLS.ABLSocketLibrary TRACE] CHUNK: FILE= /srv/medical/db/response-data-chunk-00001.txt [OE.N.SC.ClientSocket DEBUG] ReadHandler:OnDataReceived time(ms)=40 [OE.N.SC.ClientSocket DEBUG] ReadHandler: ReadComplete? yes [OE.N.SC.ClientSocket DEBUG] ReadHandler: ReadTimeout? no [OE.N.SC.ClientSocket DEBUG] ReadHandler: ReadTerminated? no [OE.N.SC.ClientSocket DEBUG] WaitSync: total time(ms)=,178 [OE.N.SC.ClientSocket DEBUG] WaitSync: total size(b)=488 [OE.N.SC.ClientSocket DEBUG] Disconnect: -H hr-nbs-ite-domname.northeurope.cloudapp.azure.com -S 80 My response-data-received.txt file looks like this (on Windows I get HTTP/1.1 and Transfer-Encoding: chunked, which I can not force on Linux..): HTTP/1.0 200 OK Cache-Control: private, max-age=0, no-cache, no-store, no-transform, must-revalidate Pragma: no-cache Content-Type: application/json; charset=utf-8 Content-Language: en Expires: Thu, 01 Jan 1970 00:00:00 GMT Server: Kestrel Date: Mon, 14 May 2018 17:30:00 GMT X-Cache: MISS from firewall X-Cache-Lookup: MISS from firewall:3128 Via: 1.0 firewall (squid/3.1.20) Connection: close {"operationCode":11110100,"information":"The pack is active.","state":"Active"} Bellow is my simple code. In file /tmp/data.json I only get empty brackets {}, and oResponse:ContentLength is 0. When I tried access JSON values, I got Progress error: Call to Progress.Json.ObjectModel.JsonObject:GetCharacter( ) failed. Property 'state' was not found. (16058) oRequest = RequestBuilder:get(httpUrl) :AcceptJson() :AddHeader("Authorization", access_token) :AddHeader("emvs-data-entry-mode", "manual") :AddHeader("Accept-Language", "en") :WithTransferEncoding(OpenEdge.Net.HTTP.TransferEncodingEnum:Chunked) :HttpVersion("HTTP/1.1") :request. oResponse = ClientBuilder:Build():Client:Execute(oRequest). if oResponse:StatusCode <> 200 then message 'ERROR: Data retrieving..' ' HTTP Status Code:' oResponse:StatusCode oResponse:StatusReason view-as alert-box. if oResponse:ContentType = 'application/json' then cast(oResponse:Entity, JsonObject):WriteFile('/tmp/data.json'). message oResponse:StatusCode oResponse:Version oResponse:ContentLength view-as alert-box. Any help would be appreciated.

Continue reading...
 
Status
Not open for further replies.
Top