[Progress Communities] [Progress OpenEdge ABL] Forum Post: Codepage problem with HttpResponse

Status
Not open for further replies.
A

Arno van der Ende

Guest
Is it possible to determine the codepage from a HttpResponse? I have a response where the Entity is of type 'OpenEdge.Core.Mempt'. However, I expected it to be of type 'OpenEdge.Core.WidgetHandle'. In the logigng I see the Content-Type is changed from application/xml to application/octet-steam: [18/10/30@14:56:15.191+0100] P-004440 T-003948 1 AS-10 LogMgrWrtr [OE.N.HTTP.L.ABLS.ABLSocketLibrary ERROR] EXTRACT ENTITY ERROR [18/10/30@14:56:15.191+0100] P-004440 T-003948 1 AS-10 LogMgrWrtr Error(s) raised: [18/10/30@14:56:15.191+0100] P-004440 T-003948 1 AS-10 LogMgrWrtr X-NODEREF or X-DOCUMENT LOAD got an error: FATAL ERROR: file 'MEMPTR', line '1', column '1', message 'exceeded byte limit at byte '�' in a 6-byte sequence'. (9082) (9082) [18/10/30@14:56:15.191+0100] P-004440 T-003948 1 AS-10 LogMgrWrtr [OE.N.HTTP.L.ABLS.ABLSocketLibrary ERROR] EXTRACT ENTITY: Response entity contains raw message body [18/10/30@14:56:15.191+0100] P-004440 T-003948 1 AS-10 LogMgrWrtr [OE.N.HTTP.L.ABLS.ABLSocketLibrary ERROR] EXTRACT ENTITY: Response Content-Type changed from application/xml to application/octet-stream I analyzed the request with PostMan, but PostMan also does not show the correct character. When I read the String from the Memptr, I also get an error: oMemptrResponseData = CAST(oHttpResponse:Entity, OpenEdge.Core.Memptr). message oMemptrResponseData:GetString(1). The GetString error raises error: Large object assign or copy failed. (11395) That error is because of the invalid character in the middle of the response. See also: knowledgebase.progress.com/.../000049503 To get around this, I can read the Memptr response and convert to iso8859-1: copy-lob from oMemptrResponseData:Value to lcXmlResponseData convert source codepage "iso8859-1". Now I see the response contains a 'ü' character. However, how can I know the source is 'iso8859-1'? BTW: My session is UTF-8 (CPINTERAL & CPSTREAM). Some extra code how I get the Response: CREATE X-DOCUMENT hXmlRequestData. lcInput = " 2018-10-01 2018-10-08 ". hXmlRequestData:LOAD("LONGCHAR", lcInput, FALSE). oXmlRequestData = NEW WidgetHandle(hXmlRequestData). oHttpRequest = RequestBuilder:post(" localhost:18000/.../" , oXmlRequestData):ContentType("application/xml"):AcceptXml():Request. oHttpResponse = ClientBuilder:Build():Client:Execute(oHttpRequest).

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