N
Niall Morgan
Guest
Hi Peter, unfortunately this didn't work. I get a error on this line oBody = new Memptr(encdmptr). The error is "could not find class or interface Memptr ." I have defined the vars as follows. DEFINE VARIABLE encdmptr AS MEMPTR NO-UNDO. DEFINE VARIABLE result AS CHARACTER NO-UNDO. DEFINE VARIABLE encdlngc AS LONGCHAR NO-UNDO. def var cWebServiceUrl as char no-undo. def var oBody as class OpenEdge.Core.Memptr no-undo. and the code as follows DEFINE VARIABLE encdmptr AS MEMPTR NO-UNDO. DEFINE VARIABLE result AS CHARACTER NO-UNDO. DEFINE VARIABLE encdlngc AS LONGCHAR NO-UNDO. def var cWebServiceUrl as char no-undo. def var oBody as class OpenEdge.Core.Memptr no-undo. COPY-LOB FROM FILE "C:\Users\me\Desktop\testupload.xlsx" TO encdmptr NO-CONVERT NO-ERROR. cDocLib = "myfolder". cWebServiceUrl = " mysharepointsite.sharepoint.com/.../add(url='testupload.xlsx',overwrite=true)". oBody = new Memptr(encdmptr). /* send post request for token */ oRequest = RequestBuilder
ost(cWebServiceUrl, oBody) // or whever's needed :AcceptContentType("application/json;odata=verbose") :AddHeader("Authorization", "Bearer " + cAccessToken) :Request. /* parse response */ oJsonEntity = CAST(oResponse:Entity, JsonObject). Message oJsonEntity:GetJsonObject('d'):GetJsonObject('__metadata'):GetCharacter('id'). RETURN result.
Continue reading...
Continue reading...