Tag Archives: webservice

Reducing the Length of XML Data Returned from a Web Service

I’m working on a project for a large consulting customer.  The application we’re developing has a SOA that uses WCF services to return data.  A requirement is that the data be communicated using XML for maximum interoperability between potential heterogenous (Microsoft and non-Microsoft) environments.

The problem I’ve run into is that some of the data sets can be quite large.  We’re using the built-in functionality of the ASP.NET DatSet object to serialize the data and table schema information to XML.  This is very fast and convenient to code, but the generated XML is very verbose and adds a lot of overhead.  This resulted in errors in clients of the web service with the message “The maximum message size quota for incoming messages (n) has been exceeded“.  I increased the MaxReceivedMessageSize property on the binding in the web.config file to 50000000 (yes, that’s 50Mb), but I still ran into the same error.  I really didn’t want to keep increasing the max message size and be sending 50Mb, or even more, of XML across the wire.  Continue reading Reducing the Length of XML Data Returned from a Web Service