[Progress Communities] [Progress OpenEdge ABL] Forum Post: RE: Copy file content into a String

Status
Not open for further replies.
U

untipet

Guest
def var xmlString as longchar no-undo. copy-lob from to xmlString. It's ok, but I need to translate it to a String var, because the Web Service 'put' metod needs that type as argument. We can do something like: def var xmlLongchar as longchar no-undo. def var xmlString as String no-undo. copy-lob from file to xmlLongchar. copy-lob from xmlLongchar to xmlString. But when I print it gets cut again and I don't know why. Probably the string var cannot allocate all the required space for the content. Maybe it's a codepage format problem. [quote user="gus bjorklund"] > It is a String. the 4GL does not have a datatype whose name is String. There are “char” and “longchar”. both are terminated by a null byte, regardless of the character set being used. [/quote] Te 'post' method requires an Object var, so I'm using it for that reason. There is an example: DEFINE VARIABLE httpUrl AS CHARACTER NO-UNDO. DEFINE VARIABLE oRequest AS IHttpRequest NO-UNDO. DEFINE VARIABLE oResponse AS IHttpResponse NO-UNDO. DEFINE VARIABLE oRequestBody AS String NO-UNDO. DEFINE VARIABLE oJsonEntity AS JsonObject NO-UNDO. DEFINE VARIABLE JsonString AS LONGCHAR NO-UNDO. SESSION:DEBUG-ALERT = TRUE. httpUrl = " www.googleapis.com/.../token". oRequestBody = new String('client_id=your_client_id&client_secret=your_client_secret&refresh_token=your_refresh_token&grant_type=refresh_token'). oRequest = RequestBuilder:post(" www.googleapis.com/.../token" , oRequestBody) :ContentType('application/x-www-form-urlencoded') :AcceptJson() :Request . Thanks for the answers

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