[Progress Communities] [Progress OpenEdge ABL] Forum Post: Call to REST API Endpoint Generates Error 9318 (Using OpenEdge.Net.pl) Code Supplied in Bod

Status
Not open for further replies.
V

v205

Guest
Hello, All: This one is most likely a Cert issue but I need to be sure before I go down that rabbit hole. I am using this program (code below) and hitting an Avatax endpoint - query filter is still a TBD, but I am stuck on getting connected to the endpoint using OpenEdge.Net.pl:I am using a tweaked sample I got from a Peter Judge post on the OpenEdge Knowledgebase. Attached is the output image, too. Any help is much appreciated, as always. CODE BEGINS HERE ______________________________ block-level on error undo, throw. using OpenEdge.Net.HTTP.*. using OpenEdge.Net.URI. using OpenEdge.Net.UriSchemeEnum. using Progress.Json.ObjectModel.JsonObject. USING OpenEdge.Net.HTTP.Lib.ClientLibraryBuilder. /* *************************** Main Block *************************** */ define variable oClient as IHttpClient no-undo. define variable oUri as URI no-undo. define variable oReq as IHttpRequest no-undo. define variable oResp as IHttpResponse no-undo. define variable oCreds as Credentials no-undo. define variable oJson as JsonObject no-undo. DEFINE VARIABLE oLib AS IHttpClientLibrary NO-UNDO. oLib = ClientLibraryBuilder:Build() :sslVerifyHost(NO) :Library. oClient = ClientBuilder:Build() :UsingLibrary(oLib) :Client. oCreds = new Credentials('application', 'dummyusername', 'dummypassword'). oUri = new URI('https', 'sandbox-rest.avatax.com'). oUri:path = '/api/v2/taxrates/bypostalcode'. oReq = RequestBuilder:Build('GET', oUri) :UsingBasicAuthentication(oCreds) :AcceptJson() :Request. oResp = ResponseBuilder:Build():Response. oClient:Execute(oReq, oResp). MESSAGE oResp:StatusCode VIEW-AS ALERT-BOX. if type-of(oResp:Entity, JsonObject) then assign oJson = cast(oResp:Entity, JsonObject). /* do what you need to with the JSON here */ catch oError as Progress.Lang.Error : message oError:GetMessage(1) skip(2) oError:CallStack view-as alert-box. end catch.

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