I have a list of objects List that I need to send over a web service. The list contains about 37,000 Objects. This translates to about a 125 MB XML File if I serialized it to XML.
I think by default web services communicate via serialized XML. This leads me to believe I am actually sending 125MB file each time. In binary format this would only be about 5MB. Is there a way to make the Web Service call in binary format to avoid the large bandwidth hit?
Can you use WCF for your webservice? If so: WCF support streaming large data across the wire.
If you have any chance of compression that data on the server side to 5 MB in a ZIP or something, you could definitely stream that across to your client.
You would have something like this as your WCF service contract:
You can define methods that either take or return data as a “Stream”, and the client can then open that stream like a
FileStreamor aMemoryStream, and the data will be streamed across the wire in chunks, so you won’t need to allocate the whole data in memory before sending it to the client.Marc