new_x 1 Posted March 2 I am trying to learn to write a Delphi REST Web Service program (both the server and the client side). Currently my platform is Delphi 11 Community Edition supporting Internet Direct (Indy) 10.6.20. I searched through the Internet have not found sample codes or explanations. All I found is some videos using DataSnap project but In delphi 11 I could not Find File->New->Other->Data Snap. The only option is “Soap Server Application”. If my current version of Delphi does not support REST, Could you then provide SOAP based (server and client) source code and explanation. Since I am newbie, could anyone share source code and explanations. Thanks in advance Share this post Link to post
Lajos Juhász 293 Posted March 2 You should check out https://github.com/danieleteti/delphimvcframework. What's DelphiMVCFramework DMVCFramework is a very popular Delphi framework which provides an easy to use, scalable, flexible RESTful, JSON-RPC and ActiveRecord framework for Delphi developers. DMVCFramework is the most popular Delphi project on GitHub and compiles for Windows (32 and 64bit) and Linux (64bit). DMVCFramework services can be compiled as console application, Windows Service, Linux daemon, Apache module (Windows and Linux) and IIS ISAPI (Windows). DMVCFramework works with Delphi 11 Alexandria, Delphi 10.4 Sydney, Delphi 10.3 Rio, Delphi 10.2 Tokyo, Delphi 10.1 Berlin, Delphi 10 Seattle. Share this post Link to post
new_x 1 Posted March 2 Thank you for kind reply. Just to explain further. In fact I am required to develop a web service to put data into learning platform Moodle. The data (student ID, number etc.) should be read in GUI (edit boxes) or from a postgresql db and must be inserted into Moodle platform. I will look into DMVCFramework . thank you Share this post Link to post
mvanrijnen 123 Posted March 4 also check: GitHub - andrea-magni/MARS: MARS-Curiosity Delphi REST Library Share this post Link to post
Der schöne Günther 316 Posted March 4 I am not familiar with Moodle, but I'd probably just roll my own. Take an Indy Http server, handle GET, PUT, POST requests, done. You're in full control. I never had the need for any of these 3rd party frameworks (I'm sure they're great, though). 1 Share this post Link to post
Roger Cigol 103 Posted March 4 ...and don't forget the built in Delphi Rest debugger tool (under the tools menu). Can be handy for checking what you should be sending... Share this post Link to post
David Schwartz 426 Posted March 7 DataSnap is not available in the Community Edition. There are many alternatives. Two were mentioned above. Another one that I like is from TMS Software called XData; it's not free but they have a trial version available. mORMot is another one to check out: https://github.com/synopse/mORMot I'm guessing that your Moodle thing is a separate back-end service that you're supposed to access via your self-made service. This is a very common scenario. Imagine that you want to have a web (client) app that saves photos somewhere. The front-end is kept simple, and it sends requests to your back-end where you could build an entire database that manages all of the photos yourself. A simpler approach would be to use something like Dropbox or Google Files (?) instead. Or even Google's FireBase. This would simplify your service a lot by letting it talk to the remote file service via its own API. It doesn't matter what it's implemented in -- the one you've been told to use is in Moodle, but so what? It's the API you're mainly interested in. Share this post Link to post
David Schwartz 426 Posted March 8 There's also this: https://github.com/delphi-blocks/WiRL 1 Share this post Link to post