We have done a RESTFUL server in Openedge, it works perfectly. The address where we can get the client is something like this (we use firefox plugin for test it).
The problem is when we are trying to make a client access from Openedge. It seems simple, but no documentation found abaut how to do this in Openedge. Any idea?
I was afraid about this. We have implemented a alternative solution that works in Openedge.
METHOD PUBLIC VOID CallGET( ):
DEFINE VARIABLE oRequest AS System.Net.HttpWebRequest NO-UNDO.
DEFINE VARIABLE oResponse AS System.Net.HttpWebResponse NO-UNDO.
oRequest = CAST( System.Net.HttpWebRequest:Create( "http://10.0.0.0:54985/service/rest/client/client?Id=12345&Emp=11" ), System.Net.HttpWebRequest ).
oRequest:Method = "GET".
oRequest:Credentials = NEW System.Net.NetworkCredential("restmgr", "password").
oResponse = CAST( oRequest:GetResponse(), System.Net.HttpWebResponse ).
txResponse:Text = StreamToChar( oResponse:GetResponseStream() ).
CATCH ex AS Progress.Lang.Error :
MESSAGE "ERROR" ex:GetMessage(1) VIEW-AS ALERT-BOX.
That's a valid approach, given you are on 10.2B02 or up and on Windows.
Architect of the SmartComponent Library and WinKit
I found this in 11.3 documentation
Oh, did you mean calling REST service from OpenEdge? That isn't supported yet...
Currently there is no support for accessing rest services from OpenEdge. Are you looking for any tool for testing rest services from eclipse?
Simple GET requests can be done from the SAX-READER (XML).
Everything else has to be implemented using Socket calls.
Is there an echo in here?
Consulting in Model-Based Development, Transformation, and Object-Oriented Best Practice http://www.cintegrity.com
Yes, there is a little bit of an echo :-). When a post is marked as an "answer", it is copied to the top of the thread so readers don't have to scroll all the way down, but it also stays in it's spot in chronological order. Therefore you will see the "answers" twice in the thread.
Well, that's a bit silly.
Would have thought the issue with the "echo" is more that the post with the code (even though it is answered by the questioner)(assuming the forum lets it) should be the "answer" not the validation of the code.
PS. Should also mention that REST client would be an enhancement to the product and as such, you may want to add it on the ideas page to start collecting use cases and votes to show PMs how big (or small) and issue it is.
This looks great. I have considered if it would be worth building an OpenEdge Class that could do this sort of thing. Perhaps in an Open Source environment so that peeps could add their code/improvements and perhaps their could be a community resolution. Normally I run out of time before I get to trying to nut it out.
(This is my personal idea and has nothing to do with my employer or their feelings on the subject).
Hi, please, check this one I have made
or directly on the bitbucket