Sending a binary stream via SOAP

I have a "simple" task. I have an existing project with a web service written in C # that has a method that sends a huge XML file to the client. (This is a backup file of data stored on the server that needs to be sent somewhere else.) This service also had some additional authentication / authorization. And I have an existing Delphi 2007 application for WIN32 that calls a web service to retrieve XML data for further processing. This is an outdated system that runs without installing .NET. Only problem: the XML file is huge (at least 5 MB) and should be sent as a whole. Due to system requirements, I cannot just break it down into several parts. And I'm not allowed to make significant changes to C # or Delphi code. (I can only change the method call on both the client and the server.) And I am not allowed to spend more than 8 hours of work to come up with a better solution, otherwise things will simply remain unchanged.

The modification I want to add is XML data compression (which reduces it to 100 KB), and then sends it to the client as a binary stream. Then Delphi code should accept this input stream and again compress the XML data. Now, with minimal changes to existing code, how to do this?

(And yes, I wrote the original client and server in the past, and he was never going to send so much data at the same time. Unfortunately, the developer who took it from me had other ideas, made some dumb changes, did more damage and left the company until of how my steel tip could connect to it, so now I need to fix a few things. Fixing this web service has a very low priority compared to other damage that needs to be repaired.)


Server code is based on legacy ASMX material, client code is the result of Delphi SOAP import with some additional modifications. XML is a daily update for 3,000+ users who have proven to be huge in its current design. We are working on it, but it takes time. There are more important elements that need to be fixed first, but, as I said, there is a small amount of time to quickly solve this problem.
+3
source share
4 answers

That sounds like a good candidate for HttpHandler

My good links are on my work computer (I will add them when I get the job), but you can see if this is good.

- -
...

http://www.ddj.com/windows/184416694
http://visualstudiomagazine.com/articles/2006/08/01/create-dedicated-service-handlers.aspx?sc_lang=en&sc_mode=edit

+4

5 ? , , .

, xml. () TStream.

+1

, , . . - ?

0

I would agree with Brad Bruce, HttpHandler would be fast, and with GZIP or Deflate Compression I could be wrong ... browsers are supported natively. You can get easy compression on text data for cheap processor time.

System.IO.Compression.GZipStream GZipStream = new System.IO.Compression.GZipStream("Your XML Doc Stream",System.IO.Compression.CompressionMode.Compress)
0
source

Source: https://habr.com/ru/post/1711992/


All Articles