[Progress Communities] [Progress OpenEdge ABL] Forum Post: RE: OpenEdge.Net.pl

  • Thread starter Giancarlo Alberto Somma
  • Start date
Status
Not open for further replies.
G

Giancarlo Alberto Somma

Guest
Hi, I run this program: USING Progress.Json.ObjectModel.JsonObject. USING Progress.Json.ObjectModel.ObjectModelParser. USING Progress.Lang.Object. USING OpenEdge.Core.WidgetHandle. USING OpenEdge.Core.String. USING OpenEdge.Net.HTTP.IHttpRequest. USING OpenEdge.Net.HTTP.IHttpResponse. USING OpenEdge.Net.HTTP.ClientBuilder. USING OpenEdge.Net.HTTP.RequestBuilder. DEFINE VARIABLE oRequest AS IHttpRequest NO-UNDO. DEFINE VARIABLE oResponse AS IHttpResponse NO-UNDO. DEFINE VARIABLE oEntity AS Object NO-UNDO. DEFINE VARIABLE lcHTML AS LONGCHAR NO-UNDO. DEFINE VARIABLE hXmlDoc AS HANDLE NO-UNDO. oRequest = RequestBuilder:Get(' obsv:5493/.../Clients') :Request. oResponse = ClientBuilder:Build():Client:Execute(oRequest). oEntity = oResponse:Entity. MESSAGE oResponse:StatusCode SKIP oResponse:StatusReason SKIP VIEW-AS ALERT-BOX. IF TYPE-OF(oEntity, JsonObject) THEN CAST(oEntity, JsonObject):WriteFile('temp/entity.json', true). ELSE IF TYPE-OF(oEntity, WidgetHandle) THEN DO: hXmlDoc = CAST(oEntity, WidgetHandle):Value. hXmlDoc:save('file', 'temp/entity.xml'). END. ELSE DO: IF TYPE-OF(oEntity, String) THEN lcHTML = CAST(oEntity, String):Value. ELSE lcHTML = oEntity:ToString(). /* Change extension per the Response's ContentType */ CASE oResponse:ContentType: WHEN 'application/json' THEN COPY-LOB lcHTML TO FILE 'temp/entity.json'. WHEN 'text/html' THEN COPY-LOB lcHTML TO FILE 'temp/entity.html'. OTHERWISE COPY-LOB lcHTML TO FILE 'temp/entity.txt'. END CASE. This string return a correct XML but OE cannot save as 'temp/entity.xml" but a simple txt file that contain "OpenEdge.Core.ByteBucket_7196". May can help me?

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