SOAP: Make a TADOQuery talk to a SOAP Server or replace it with a dataset

rfwoolf
rfwoolf used Ask the Experts™
on
I'm converting an existing ADO data application into a SOAP-connected one meaning that where possible all queries must now talk to a SOAP server (which I'm going to write).
So basically in my client, let's say I have a DBGrid connected to a TADOQuery, I must now keep the DBGrid, and eliminate the TADOQuery.
Is there a dataset I can use that will be easily able to take the SOAP document and display it in a DBGrid.

Update: By the way the backend will be SQL Server 2005 running on the SOAP Server. So on the SOAP Server side I planned to drop a TADODatabase and use a TADOQuery to execute queries. From there I'm not sure how I will pass that data through an interface, and I'm not sure on the client how to receive that data and easily plug it into a DBGrid.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Top Expert 2010

Commented:
You should replace TADOQuery with TClientDataSet.

Then you should add TSOAPConnection and set it as a value for TClientDataSet.RemoteServer property. Then connect to SOAP server and select ProviderName.

Look at Dr Bob's article: http://www.ebob42.com/cgi-bin/Soap42.exe?Client=%40&DB=%40&Server=D&Web=%40

Author

Commented:
Cool but my problem there is that on the SOAP Server side, in his tutorial he has 's used a ClientDataSet with filename set to an XML file.
Here we want the dataset to link to an SQL Server database.
I need to know if that will work.
So on the SOAP Server side, I'll have a SOAP Data Module, I'll have a a DataSetProvider and link it to an TADOQuery.

And assuming this works, what I also need to know is whether the data that gets transported between the SOAP server and client are SOAP packets in xml format - otherwise there's no point.

Author

Commented:
Okay well I've tried it out and confirmed that it works with SQL Server.
You'll have to forgive me for thinking that it only worked in Bob's article because he was connecting to an XML file database and SOAP is xml-based.
But now I need to know if my datasets are really using SOAP and whether their SOAP packets will be useable by other applications.

Author

Commented:
Also, any idea on the best way to pass a query parameter from the client to the TADOQuery on the SOAP Server?

It would be nice if I can have on the Server something like Q_OrdersForAClient with SQL: "SELECT * FROM ORDERS WHERE CLIENT_ID = :CLIENT_ID" and then from the client I'll pass CLIENT_ID = 321
Top Expert 2010
Commented:
There is the same "thin" client in the end of Bob's article:  TSOAPConnection and TClientDataSet

There is no difference what database you are using on the server-side: MS SQL, Oracle or just xml file

You can use CliendDataSet.Params property to send params to the server. TDataSetProvider will automatically pass they to appropriate TQuery. Look at delphi/demos/midas/SetParam

Also you can catch the Params in BeforeGetParams/AfterGetParams events of TDataSetProvider

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial