5

I've been looking for some way to let a Delphi program communicate with a RoR service. I could use any of the SOAP libraries out there e.g.: ActionWebService to offer a SOAP service, which I could then use in the Delphi program.

However, this requires one to reimplement all the ActiveRecord methods (such as find) over and over again. This is a hassle even if they are only delegation methods.

Who knows of a simpler / easier / cleaner way?

Alessandro Vermeulen
  • 1,321
  • 1
  • 9
  • 28

2 Answers2

1

There is no such bindings, REST isn't a protocol but just convention over http. I know about activeresource port for Java http://jactiveresource.org/ , but there is no such one for delphi. But you can watch sources of jactiveresource and try develop your own functionality. But you also can create rest client and wrap it with methods you need and unserialize responses into objects. Here is a short example http://dn.embarcadero.com/article/40449

Fivell
  • 11,829
  • 3
  • 61
  • 99
0

RoR use REST and MVC design paterns, that means you only need an HTTP client and an XML or JSON library. I suggest you to watch this video to understand how it works. http://www.youtube.com/watch?v=YCcAE2SCQ6k

You can keep using existing controllers, you just have to put "application/json" in the "Content-Type" HTTP header to post data and add .json instead of .html to get JSON data instead of HTML.

Henri Gourvest
  • 989
  • 8
  • 12