Board index » delphi » Delphi and REST

Delphi and REST


2008-06-19 01:00:26 PM
delphi156
Hello,
With all the hoopla recently surrounding RESTful web services, is there
an easy way to produce REST servers and clients in Delphi?
--
 
 

Re:Delphi and REST

Hello David,
We don't currently offer any runtime for REST. I was asked to research this
item a few months [a year?] ago. My conclusion was the same as my previous
foray into REST: until the 'description language vs. no description
language' issue is settled, we really can not do much. At the time there were
several proposals ( this url lists some:
docs.google.com/View ) but the very notion of
a description language had strong resistance...
I wonder if things have changed recently? I am making a note to research this
again.
Cheers,
Bruneau
 

Re:Delphi and REST

Hello,
As far as I understand (admitedly not much) the point of REST is that it is quite simple and user defineable. Thus, I'd not worry about the ability to consume a "REST Definition" from someone else, at this point. Even something as simple as an easy way to easily make a REST server/Client within Delphi would be fine.
Very similiar to THTTPRio but uses REST as a transport, not soap.
For instance, if I make a
IMyRestObject=interface
function foo(a:integer):integer;
end;
I will then make a TRestServer implements IMyRestObject that knows to make a cgi that accepts
http://mysite/restobject/foo.html?a and then when you implement it on the server returns something like
<result>someInteger</result>
For the client, I just have to call
TRestClient=class(T...,IMyRestObject)
function foo(a:integer):integer
end
and when I call foo on the client, it knows to call the correct URL and knows how to send and receive the data.
Even if this is Delphi only, it may have advantages. The messages sent via REST are much easier to understand than SOAP messages and if one wants to, its much easier to send/receive/alter the messages manually, since its easy to understand what is going on.
AFAIK, there is no easy way to "automatically" consume someone elses REST server, that is, by definition, the major difference of REST vs SOAP. REST is simpler, but not self describing. SOAP is complex, but in theory the packets tell you everything that you need to know.
--
 

Re:Delphi and REST

David Novo schrieb:
Quote
Hello,

With all the hoopla recently surrounding RESTful web services, is there
an easy way to produce REST servers and clients in Delphi?

in case you consider .net here is something:
blogs.codegear.com/pawelglowacki/2008/06/09/38511/
In The latest Mastering Delphi book from Cantu there is an example how
to build a Rest WebService with Indy. Code for his book is here:
www.marcocantu.com/md2005/
 

Re:Delphi and REST

Hi Ralf,
Thanks for the tips!
--