开发者

Web service that handle BLOB data

There is a need to develop some "Service" program that will receive and process BLOB data from Oracle DB server. The clients will be written in Delphi 2010. I have freedom of choice that technologies I will use to produce server part of this project. And that's why I have posted this question here. Could you guys point me some blog posts, articles, forums where I can get various information about creating such type of services? I have an experience with Microsoft's WCF services, but it has bas intergration with Delphi clients via WSDL. Now I stopped on ASMX Web Service written in C# and need to get some samples how can I transfer BLOB data between server and client. It would be better if server and client communicating thru raw s开发者_如何学JAVAocket, instead of incapsulation all data in SOAP. Thanks in advance and strongly hope for you help, guys!


I would recommended you to use RemObjects SDK for develop server & client web services applications, it has many features not available on Delphi & .Net, also they support different messaging, so you can use binary message instead of SOAP to transfer the BLOB data, which is much faster and more compact.

They also .Net version of server and client so you can mix between them.


A nice and standard way of handling BLOB fields is the REST protocol.

Thanks to the REST protocol, you can GET, POST, PUT or DELETE a binary BLOB from its URI. That is, if your URI is dedicated to the BLOB field, you'll be able to use raw binary transmission, and no MTOM or Base64 transmission.

For instance, you can get a BLOB content with ID=123 with a GET at such an URI:

  http://servername/service/123/blob

It will work also from a standard web browser. So if the BLOB is a picture, it should be displayed directly in the browser.

With a POST at the same URI, you add a new blob, or with a PUT you update the blob. With a DELETE verb... you delete it. This is what RESTful means over HTTP.

This is, for instance, how our mORMot framework works. It is also able to fast have direct access to the Oracle database on the server side, with some dedicated classes. What is nice with such an ORM-based framework, is that high-level clients can use objects, and handle much more than only BLOBs, and that it handles URL-level security and authentication.

But you can easily write your own service using some units available in mORMot, if you don't need the whole RESTful ORM feature:

  • For a fast http.sys based HTTP/1.1 server, take a look at SynCrtSock;
  • For the HTTP/1.1 client access, the same SynCrtSock unit defines some client classes;
  • For very fast direct access to Oracle, see SynOracle.

This is all Open-Source, working from Delphi 5 and later. There is a lot of documentation available (more than 600 pages), including high-level presentation of such concepts as REST, ORM or n-Tier.


This is fairly high-level, but so is the question:

If it is a "raw socket" it isn't really a "web service"; although there is of course the middle ground of REST or a HTTP POST.

If you are looking at a web-service, and the data is non-trivial, then you probably want to look at MTOM to avoid the base-64 overhead (which is supported in WSE 3, or (simpler) WCF via basicHttpBinding). I would expect most tools to have a reasonable comprehension of a basic web-service with MTOM.


if you want to expose some data in a data base (in this case blob data in oracle) as a web services WSO2 DSS[1] provides an easier solution. This is under Apache license and it is available for free. Since all the WSO2 Products are based on WSO2 carbon platform the services you create supports MTOM, WS-Security and other Web service related features as well.

[1] http://wso2.org/library/dss

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜