views:

1765

answers:

4

In the sample Delphi web service tutorials I've read, they tend to build a web service that returns a simple string or integer, e.g.

http://blogs.codegear.com/pawelglowacki/2008/12/18/38624

However, I read it's possible in .NET to build a web service that returns a DataSet or even an object. Is this possible in Delphi 2009, and if so where can I find more info on this?

Also, what's your opinion on tools for building a web service, between Delphi and .NET?

+1  A: 

Yes, it is possible to do so; you can do it by using Delphi's DataSnap with SoapConnection. DataSnap is Delphi's multi-tier solution. In Delphi 2009 it saw a major update, and named DataSnap 2009, but DataSnap 2009 doesn't yet support some features of old DataSnap, like using WebServices for communication. The good news is that the older DataSnap is still available in Delphi 2009, and you are not forced to use DataSnap 2009.

vcldeveloper
+1  A: 

Delphi 2009 has full suport for returning classes and datasets from webservices. Datasnap is the framework that supports datasets you can find more information in this video by Nick Hodges, Delphi Product manager, this whitepaper by Marco Cantù (whitepaper extracted from his book “Delphi 2009 Handbook” and this code by Bruno Lichot.

Tiago Moraes
A: 

OK, please let me know if the following is correct:

DataSnap 2009 can transmit datasets, but does not support communication via web service. i.e. both the client and server must be written in Delphi 2009?

Plain old DataSnap can transmit datasets using web service, but requires COM?

So next question would be, what would be use to consume a dataset returned by a web service?

Robo
A: 

As far as I know, .Net and Java clients can access DataSnap 2009 server too.

Old DataSnap doesn't use COM for SoapConnection, but COM is used for other kinds of connections (e.g. socket connection).

So next question would be, what would be use to consume a dataset returned by a web service?

On the server side, you can put DatasetProviders which connect to the dataset controls, and provide datasets for clients. On the client side, ClientDataset is used to receive data provided by DatasetProviders on the server.

vcldeveloper