If you happen to develop a WCF service that needs to deliver large amount of data to your Silverlight application, you might run into the problem that the data will never reach your application but instead you might just get an exception like „System.Net.WebException: The remote server returned an error: NotFound„.
There are two possible reasons for this:
- The transfer mode of your service being set to „Buffered“ and the size of the data being transferred is bigger than the buffer size.
- There are two many items to be serialized and deserialized by the DataContractSerializer.
WCF Services with Large Responds weiterlesen
NetFX Harmonics provides a in-depth and well written introduction on how to write and use WCF services in Silverlight applications:
In this document, I’m going to talk about how to access WCF services using Silverlight 2 without magic. There will be no proxies, no generated code, no 3rd party utilities, and no disgusting „Add Service Reference“ usage. Just raw WCF. This document will cover WCF connectivity in quite some depth. We will talk about service setup, various WCF, SOA, and Silverlight paradigms, client setup, some security issues, and a few supplemental features and techniques to help you aide and optimize service access. You will learn about various WCF attributes, some interfaces, and a bunch of internals. Though this document will be in depth, nothing will ever surpass the depth of MSDN. So, for a more full discussion on any topic, see the WCF documentation on MSDN.
Even though we’re focusing on Silverlight, most of what will be explained will be discussed in a .NET context and then applied to Silverlight 2. That is, instead of learning .NET WCF and Silverlight WCF, you will .NET WCF and how to vary this for Silverlight. This comparative learning method should help you both remember and understand the concepts better.
Read the full document here.