Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: Need suggestions for building a custom servers api (REST, SOAP, other?)


This question is answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 6 - Last Post: Jan 29, 2018 5:11 AM Last Post By: Scott Gast Threads: [ Previous | Next ]
Scott Gast

Posts: 82
Registered: 4/2/04
Need suggestions for building a custom servers api (REST, SOAP, other?)  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jan 25, 2018 5:41 AM
We are designing a new database application and would love input from this community on the "best" version of Delphi to use when creating a server application with a customized API.

I've written client applications that use SOAP, but not REST. I have not yet written a SOAP or RESTful server application. What other options are available in addition to SOAP and REST?

Yes, I've Googled it, but I'd love input from y'all ... because, well.. Delphi!

Thanks,
Scott
Daniel Fields

Posts: 622
Registered: 11/29/04
Re: Need suggestions for building a custom servers api (REST, SOAP, other?)  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jan 25, 2018 9:25 AM   in response to: Scott Gast in response to: Scott Gast
My understanding is that SOAP is best for operations and business logic, while REST is best for data. I've consumed a lot of SOAP services, but only a few RESTful interfaces. Using the REST client components is far easier to implement. I also believe that REST is better for publicly exposed services, versus private.

I recently asked about using a REST service on this forum. I was able to take the answer and implement it in minutes. I've since used those same controls to interface with several other services. All of them worked on the first try.

My biggest issue with SOAP is that it uses XML (REST can use XML, JSON or even a custom format). XML is super wordy! When you start moving large amounts of data in XML parsing it can consume lots of processing resources.

Here's a good article that I found.
http://spf13.com/post/soap-vs-rest/
Zane Leo

Posts: 55
Registered: 12/29/09
Re: Need suggestions for building a custom servers api (REST, SOAP, other?)  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jan 25, 2018 9:45 AM   in response to: Daniel Fields in response to: Daniel Fields
Very much depends on the interfaces you intend to deliver / publish but I highly recommend you look at Real Thin Client (http://www.realthinclient.com).
Super stable, super fast, super scalable....

Great product and great support - just like IW is.

I have a numerous apps that use RTC and also some integrate with IW.
Dan Barclay

Posts: 889
Registered: 11/9/03
Re: Need suggestions for building a custom servers api (REST, SOAP, other?)  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jan 25, 2018 10:37 AM   in response to: Scott Gast in response to: Scott Gast
Scott Gast wrote:
We are designing a new database application and would love input from this community on the "best" version of Delphi to use when creating a server application with a customized API.

I've written client applications that use SOAP, but not REST. I have not yet written a SOAP or RESTful server application. What other options are available in addition to SOAP and REST?

Yes, I've Googled it, but I'd love input from y'all ... because, well.. Delphi!

One of those is probably best for a public API, and maybe easier to implement since most of the plumbing is done for you.

But, you asked "what other options...". If you have a high volume and want to optimize bandwidth and processing you might consider raw data transfer, building your own connection. Indy has a bunch of options that make it fairly straightforward. There are big tradeoffs for getting rid of the "fluff" and "decoration" of the SOAP/REST in terms of making your interface proprietary and having to do more of the data movement plumbing... but you asked. It's not that hard, but probably not the right option unless you are trying to solve throughput issues.

Indy opens up a lot of options like that.

Dan
Joel Zimmer

Posts: 68
Registered: 9/24/01
Re: Need suggestions for building a custom servers api (REST, SOAP, other?)  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jan 25, 2018 10:54 AM   in response to: Scott Gast in response to: Scott Gast
Scott Gast wrote:
We are designing a new database application and would love input from this community on the "best" version of Delphi to use when creating a server application with a customized API.

I've written client applications that use SOAP, but not REST. I have not yet written a SOAP or RESTful server application. What other options are available in addition to SOAP and REST?

Yes, I've Googled it, but I'd love input from y'all ... because, well.. Delphi!

Thanks,
Scott

Have you looked at RemObjects? It works well with IW and you can simply publish the api in many different ways.
Jose Nilton Pace


Posts: 122
Registered: 5/15/98
Re: Need suggestions for building a custom servers api (REST, SOAP, other?)  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jan 26, 2018 9:41 AM   in response to: Scott Gast in response to: Scott Gast
Hi Scott. If you like delphi + IW, do it in Delphi + IW. Use this demo: https://github.com/Atozed/IntraWeb/tree/master/XIV/Delphi/CustomContentHandlers and response everything to everyone in Json/Xml/whatelse.
initialization
  TIWServerController.SetServerControllerClass;
 
  // http://127.0.0.1:8888/yourAPI/v1/samething will be redirected to this handler.
  with THandlers.Add('yourAPI', '', TContentAPI.Create) do begin
    CanStartSession := True;
    RequiresSessionStart := False;
  end;
 
end.

yourformapi.pas (TContentAPI)
   Result := True;
   if Assigned( aReply ) then begin
      aReply.ContentType := MIME_JSON;
      aReply.WriteString( '{"ip":"127.0.0.1","port":8888, "PathInfo":"' + aRequest.PathInfo + '"}' );
   end;
 
   aSession.Terminate;

This is another way that maybe can serve you.
Scott Gast

Posts: 82
Registered: 4/2/04
Re: Need suggestions for building a custom servers api (REST, SOAP, other?)  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jan 29, 2018 5:11 AM   in response to: Jose Nilton Pace in response to: Jose Nilton Pace
Thank you to everyone for your input on the architecture for our new browser based cost accounting system!

It may not be on the cutting edge, per se, but it looks like we're going to go with SOAP. :) I figure that we can always build the RESTful server once SOAP in in place.

Thank you for everyone's input! Delphi nerds rock.

Scott
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02