Datasnap vs SoapServer - delphi

What are the advantages in using DataSnap compared to writing a
soapserver application.
I know Datasnap can use TCP/IP instead of soap.
Regards
Sandeep

With DataSnap you can export any number of datasets, and server methods, without the need of manually serialize them, adding built-in funcionality of parameterized querys, in wich value of the parameters are defined from the client. On the client side, you just have to connect to the remote datasource or methods to any data aware control using a ClientDataSet as data cache, with automatic update command generation.
SOAP is a more raw way to do everything, and IMHO the only thing you gain using WS is compatibility. If you are not using Delphi on the client side, then that is the way to go.

DataSnap is a remoting technology which directly supports Delphi database architecture. Actually DataSnap supports SOAP too - check the TSoapConnection component (but of course a plain SOAP server is not a Datasnap server also).
Be aware that currently exists two Datasnap implementation. The "older" one using DCOM/SOAP and a "newer", dbExpress-based one, supporting TCP and HTTP/REST.

Related

How do I create a Dart Server database?

I know that it is possible to create a IndexedDb at client side, but I was wondering if it possible to create a key/value store server Side. In that case we could use that db as a cache server or even as an elasticSearch server, or maybe replace a SQL or NoSQL database
Unfortunately it is not possible to create an IndexedDb on the server in Dart. The implementation primarily leverages the APIs provided by the client-side navigator (eg. Chrome, Firefox, etc). IndexedDb is a developing web standard which will hopefully be implemented in all browsers in the future. In this way, Dart is basically using APIs to access a separate database (albeit a very simple one). It is not implemented in Dart itself.
That said, in addition to other serverside database APIs, there is also a Dart client interface for memcache which can be run on the sever to connect to a memcache instance
You can use any database on the server where a Dart driver is available (not so many yet, but in the future there will be support for most mainstream databases.
take a look at
https://pub.dartlang.org/packages/yomp_db
http://pub.dartlang.org/packages/mongo_dart
http://pub.dartlang.org/packages/sqljocky

How to add SOAP interface for Delphi Synapse HTTP Server?

I've got a custom HTTP Server created using Delphi 7 and Ararat Synapse which receives HTTP GET from another application with a simple set of variables.
For example: http://myserver.com/get?Variable1=adsds&Variable2=asdasdasdsa&Variable3=aasdsadasdsad
The application source is similar to this - http://searchco.de/codesearch/view/13374072
Now, my customer needs me provide a SOAP interface. Completely new to SOAP, I did some research and found it to be very complicated. I would like to know what's the easier way to incorporate this interface to my HTTP server. Or should I find ready made SOAP To HTTP Conversion app if there is such a software. Thank you.
Note: I'm not the original developer of the HTTP Server.
There is a Web Service Toolkit for Free Pascal and Delphi which can be used to write SOAP servers.
I have not yet used it myself but it is in active development and might be compatible with Synapse.
Update: the current version seems to include support for Internet Direct (Indy) and Synapse (HTTP server and TCP server).
You need to write a SOAP server, which not only generates SOAP responses from SOAP requests, but which also provides a WSDL document telling the users what requests they can make.
Since your completely new to SOAP here are some 'starter' links:
General:
SOAP, WDSL, HTTP, XSD? What the?
List of publicly available web services (I would start writring a small testapp that consumes SOAP)
With Delphi:
Developing Web Services with Delphi
Web Services Made Easy With Delphi
Web services with Delphi
The fact that you are using Delphi 7 makes things more difficult, since later versions have better support:
Debugging/Testing Win32 SOAP Web Services (D2007). Bob has more SOAP articles
For testing both serving and consuming SOAP you should use SoapUI, a great free tool (What is SOAPUI?).
Once you are up to the WDSL you should know what types of WSDL exist and the whole namespaces mess...

Using DataSnap and Advantage Database Server

I have tried to use DataSnap on Advantage Database but I cannot update my data. I use TAdsQuery on datasnap server and return the query to client and link it with TDataSetProvider.
I traced into and saw Delphi applies updates using TSQLConnection not my TAdsConnection I have in server side.
Any idea?
I wrote a white paper for Advantage (Sybase) to show how Advantage Database Server and Delphi's DataSnap work just fine. I'm not sure what/where your problem is exactly.
Check out http://www.drbob42.com/examines/examinD8.htm for the DataSnap Server and http://www.drbob42.com/examines/examinD9.htm for the client.
The DataSnap client uses a TSQLConnection to talk to the DataSnap Server. The DataSnap Server uses a TAdsConnection to talk to the Advantage Database Server. The client never has any "knowledge" about the actual database; that's what the server is for.
Groetjes, Bob Swart

Rest webserver using webbroker in BDS2006

Could you give me a tip on how can implement a rest webserver using just webbroker?
I know newer versions of delphi has this REST/JSON/DATASNAP features, but i´m stuck with BDS2006.
Basically i need to interact with other application and the guys are asking me to make this webserver application and provide just five methods over the internet/vpn. Don´t need to be running inside IIS or Apache.
I´ve googled a lot but the answers always point to 2010 and up versions. All that readings lead me to use the webappdebug template make some actions and respond to GET/POST/PUT/DELETE with some JSON objects.
The problem is ... I´m not well versed with webbroker, how can i achive this?
THANKS IN ADVANCE, ANY HELP WILL BE WELLCOME.
Our full RESTful Client-Server framework is availble, including an ORM (and much more), named mORMot.
It is an Open Source project, running from Delphi 6 up to XE2 - so it will work with Delphi 2006 (I've tested it with Delphi 7 and 2007 so I do not see any reason why BDS 2006 would fail).
It is able to serve Objects and Services (just like DataSnap) using JSON, in a secured (using per URL authentication) RESTful protocol.
It is able to use any Database engine back-end, with a SQLite3 kernel. You can even use without any database layer at all (that is without SQLite3), if you need only the RESTful services and in-memory objects feature (you can persist the objects with JSON or in binary format, but you won't be able to use advanced features like cross-table search).
More than 700 pages of documentation available.
For HTTP/1.1 communication, it is not based on WebBroker (nor IIS, nor Apache), but it will use directly the high-speed http.sys kernel-mode service.

Delphi SoapServer application

Is it possible to convert Delphi SoapServer application to use TCP/IP?
From your comment to your question it sounds like you are looking to get rid of SOAP, and use something else to communicatie over a TCP/IP connection.
The question one could ask is why do you want to convert to non-SOAP comm over TCP/IP?
But the answer to whether it is possible is: of course this is possible, there are many application servers using TCP/IP for communication without using SOAP as their communication's protocol.
You will need some kind of protocol for communication between server and clients. You could roll your own, but doing what SOAP is doing for you now: receiving and responding to commands from clients (or method invocation) and marshalling data/objects between server and clients is not a trivial task.
So I'd suggest you have a look at other remoting libraries for client/server communication, such as:
Remobjects: http://www.remobjects.com/
kbmMW: http://components4developers.com/
As others have said, SOAP is just XML on http/https, and usually does already use TCP.
That said, you could simply treat it as raw socket data or http data. i.e. you could make a client that just uses http POST to send a string to the server. The string would contain an XML SOAP request, and would be treated by the server as if it were SOAP. Likewise, you could build the server in a non-SOAP fashion, just accepting XML and returning XML, and the client wouldn't know the difference.
You can use Fiddler2 to play with this. You can build requests and send them via HTTP Post. The server has no idea that you're not a SOAP client.
Chris
If you're talking about pre-Delphi
2009 DataSnap, meaning COM based
DataSnap, then you have to use a third
layer utility to do the communication.
That utility named sockets.exe is
included with Delphi, and is in the
same dir as Delphi (Program
Files\\\\bin
If it is Delphi 2009 or better, then
DataSnap has built-in TCP/IP
functionality. You use
TDSTCPServerTransporter component.
Update: Ups! for some reason I did read DataSnap SoapServer (wich neither exists, but I did think of Soap Connection).
A Soap Server Application needs the "server" part, meaning a web server. SOAP is an technologie that runs over HTTP protocol, so I don't think it could be "converted".
DataSnap could do the job, or Indy TIdTCPServer or some of the derived classes.

Resources