[Progress Communities] [Progress OpenEdge ABL] Forum Post: OpenEdge 11.6.4 - REST error 403

  • Thread starter Thread starter atuldalvi123
  • Start date Start date
Status
Not open for further replies.
A

atuldalvi123

Guest
Hello, I've been getting a 403 error whenever I try and access a REST Service resource set up and published on an active PASOE server. I am passing query string parameters to the service and getting output parameter from the same. Both input and output mapping details is correct ( used REST Resource URI Editor). Below is the ABL call to the service - /* *************************** Definitions ************************** */ USING OpenEdge.Net.HTTP.*. USING OpenEdge.Net.URI. USING Progress.Json.ObjectModel.JsonObject. DEFINE VARIABLE oClient AS IHTTPClient NO-UNDO. DEFINE VARIABLE oURI AS URI NO-UNDO. DEFINE VARIABLE oCredentials AS Credentials NO-UNDO. DEFINE VARIABLE oRequest AS IHttpRequest NO-UNDO. DEFINE VARIABLE oResponse AS IHttpResponse NO-UNDO. DEFINE VARIABLE oCookies AS Cookie NO-UNDO. oClient = ClientBuilder:Build():KeepCookies():Client. /*CookiesJarBuilder:Build():CookieJar*/ oURI = NEW URI('http', 'localhost', 10980). #oURI:Path = '/myRestServicesService/rest/myRestServicesService/testQueryParameters?MNR=2000&SNR=1'. oURI:Path = '/rest/myRestServicesService/testQueryParameters?MNR=2000&SNR=1'. oCredentials = NEW Credentials('Tomcat Manager Application', 'tomcat', 'tomcat'). oRequest = RequestBuilder:Build('GET', oURI) :usingBasicAuthentication(oCredentials) :acceptJson() :Request. oResponse = ResponseBuilder:Build():Response. /*oClient:execute(oRequest, oResponse).*/ oResponse = ClientBuilder:Build():Client:Execute(oRequest). MESSAGE oResponse:StatusCode skip oResponse:StatusReason VIEW-AS ALERT-BOX INFO BUTTONS OK. ***************************************************** END*************************************************** *****************************************Service*********************************** @openapi.openedge.export FILE(type="REST", executionMode="external", useReturnValue="false", writeDataSetBeforeImage="false"). BLOCK-LEVEL ON ERROR UNDO, THROW. DEFINE INPUT PARAM inp1 AS INT. DEFINE INPUT PARAM inp2 AS INT. DEFINE OUTPUT PARAM out AS CHARACTER. FIND FIRST SUB Customer NO-LOCK WHERE SUB Customer.MNR = inp1 AND SUB Customer.SNR = inp2 NO-ERROR. IF AVAILABLE SUB Customer THEN out= STRING( SUB Customer.SFCODE). RETURN. ****************************************END*************************************** I tried below both URL but received same error in response. #oURI:Path = '/myRestServicesService/rest/myRestServicesService/testQueryParameters?MNR=2000&SNR=1'. oURI:Path = '/rest/myRestServicesService/testQueryParameters?MNR=2000&SNR=1'. Below is the response If I try these URLs from browser - An error occurred while executing your request! 403 - Forbidden: the server refuses to fulfill the client's request - GET /myRestServicesService/rest/myRestServicesService/testQueryParameters Error details Remote user: null User principal: null Scheme: http Remote address: 0:0:0:0:0:0:0:1 Server name: localhost PASOE product type: dev HTTP status: 403 Error detail: Access Denied Pls suggest.

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