开发者

Using Intraweb to communicate with another website

Delphi 5 Pro Intraweb 7

I have an Intraweb application that uses a "legacy" back 开发者_StackOverflowend (B-Tree Filer) with a TDataSet descendant to handle the data access. All is fine and dandy on my end.

But, I now have some outside websites requesting to access my data. I've done simple HTML Form Posts and Gets as a communication tool to handle some integration with other sites but one of the requests is now asking me to send a "table" of data back. Each row of the table represents an individual record.

How could I accomplish this with my current setup? Would I POST back with a XML document and let the other site handle the "table" on their end? Is there a DataSet (as in the VB or .Net world definition of Dataset) equivalent I could use in Delphi and if so, how would I send it back to the site making the request?

Any thoughts and suggestions would be greatly appreciated.


A HTTP POST (back to the other party) is a good idea, using an asynchronous operation allows to run the data collection and conversion outside of the HTTP request. (See slide 4 of the presentation "Dopplr: It's made of messages" by Matt Biddulph)

Your server would receive a small HTTP GET request (something like /context/loaddata?table=TABLENAME&from=1000&records=100), store this request and immediately return a response with a simple OK.

Then your server would collect and prepare the (XML or JSON encoded) table data and finally send a HTTP POST with this document to the other party's web server. If this operation fails, it can be easily retried until the other server answers with a OK.

So if data preparation and conversion takes a long time, the other party would not have to wait (and maybe experience a request timeout) while your server is busy fetching and converting the data.


First, I would like to know what the other side is using (PHP, Java, etc), and whether or not SOAP/XML, JSON/REST, etc are already "in their list of things they know how to do". Then I would go with that.

You may need to provide for them, either a SOAP or JSON server service, or some other custom document (HTML/XML/JSON etc) otherwise provide raw data to them in a format they can read, and give them the URLs that they would need to know to get at this data, which you obviously intend for them, instead of for the general browser-using public accessing your website.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜