Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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 socket, instead of incapsulation all data in SOAP. Thanks in advance and strongly hope for you help, guys!

like image 356
kseen Avatar asked Feb 24 '23 00:02

kseen


2 Answers

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.

like image 107
Mohammed Nasman Avatar answered Mar 03 '23 22:03

Mohammed Nasman


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.

like image 27
Arnaud Bouchez Avatar answered Mar 03 '23 21:03

Arnaud Bouchez