[Progress Communities] [Progress OpenEdge ABL] Forum Post: Data from a web service call has different encoding with different version of OE

Status
Not open for further replies.
M

Mark Davies

Guest
Hi, I am trying to figure out if there is some sort of reason why a call to a web service in OE10.2B will have a different result than OE11.3. My situation is as follows.. I have to make a web service call (REST) and for ease of use I have opted to use the MS WebClient library. In my development environment I am running on OE11.6 - all fine and result is as expected. My client's application is running OE10.2B as there is no quick way to upgrade their application version at this time - hence the reason for using something other than the OE libraries to make the call. The call is simple and works in both versions of OE, but when I get the response from the call in OE10.2B it seems to be in a different encoding. However, running the exact same code in OE11.3 it is in UTF8, as expected. This is a sample of the call: DEFINE VARIABLE oWebClient AS WebClient NO-UNDO. DEFINE VARIABLE cResponse AS LONGCHAR NO-UNDO. DEFINE VARIABLE oData AS "System.Byte[]" NO-UNDO. oWebClient = NEW WebClient(). oWebClient:Headers:Add("Content-Type","application/x-www-form-urlencoded"). oWebClient:QueryString:Add("Param1", "Value1"). oWebClient:QueryString:Add("Param2", "Value2"). ASSIGN oData = oWebClient:UploadValues("requestUrl","POST",oWebClient:QueryString). cResponse = UnicodeEncoding:UTF8:GetString(oData). COPY-LOB FROM OBJECT cResponse TO FILE "D:\temp\test.json". Why would OE10.2B cause the result to be different? I checked the cpinternal for both versions and they are set the same.

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