[Progress Communities] [Progress OpenEdge ABL] Forum Post: RE: Is there a way I can access HTTP Header in a incoming HTTP Request for an OE REST servi

Status
Not open for further replies.
M

Mike Fechner

Guest
Pretty sure only simple parameter types like Character and Integer etc. are supported for REST interfaces. Sent from Nine Von: Walter Mangra Gesendet: Montag, 14. Mai 2018 02:56 An: TU.OE.Development@community.progress.com Betreff: RE: [Technical Users - OE Development] Is there a way I can access HTTP Header in a incoming HTTP Request for an OE REST service call ? Update from Progress Community Walter Mangra As suggested I tried adding ReqHeader to the Service_Interface code, but when I tried to map the HTTP GET once more I am getting the following error: Rest file include Invocation file generation failed. The procedure includes unsupported data types "openedge.net.http.httpheader". Remove the unsupported parameter data types from the following procedures(s): "Read1" to successfully generate REST invocation file. Any ideas on how to recover the userid/password from the request header since I am sending it to the OEPAS instance ? /* Code from Service_Interface block-level on error undo, throw. using Progress.Lang.*. /* *************************** Definitions ************************** */ define variable CustInfoInstanceRead as AppServer.CustomerDispatcher no-undo. define input parameter CustId as integer no-undo. define input parameter ReqHeader as OpenEdge.Net.HTTP.HttpHeader no-undo. define temp-table custrecord like Customer. define output parameter TABLE for custrecord. define output parameter reason as character no-undo. CustInfoInstanceRead= new AppServer.CustomerDispatcher(). CustInfoInstanceRead:Read1(input CustId,input ReqHeader,output TABLE custrecord,output reason). return. --------------------------------------------------------------------------------------------------------------- /* Snippet from CustomerDispatcher Class */ @openapi.openedge.export(type="REST", useReturnValue="false", writeDataSetBeforeImage="false"). method public integer Read1(input custId as integer, input ReqHeader as OpenEdge.Net.HTTP.HttpHeader, output TABLE custRecord, output httpReason as character): define variable httpStatus as integer initial 200. /* Assume 200 status code */ empty temp-table custRecord. find first Customer where Customer.CustNum = custId no-error. if available Customer then do: create custRecord. buffer-copy Customer to custRecord. end. else do: httpStatus = 404. httpReason = "ERROR: Customer " + STRING(custId) + " not found]". end. release Customer. return httpStatus. end method. View online You received this notification because you subscribed to the forum. To unsubscribe from only this thread, go here . Flag this post as spam/abuse.

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