SYSK 377: System.ServiceModel.CommunicationException in a Silverlight 4.0 app

All the credit for the information in this post goes to Marc DeAntoni, and other Internet posts/articles that helped Marc get to the root cause!


On my current project, we were working on a proof of concept application measuring how many editable rows  x columns we can display using Silverlight 4.0, Telerik’s RadGridView control and using RIA services for data access.  All was Ok, until we hit about 1500 rows (60 columns), at which point we got the following exception:


{System.ServiceModel.CommunicationException: The remote server returned an error: NotFound. ---> System.Net.WebException: The remote server returned an error: NotFound. ---> System.Net.WebException: The remote server returned an error: NotFound.

   at System.Net.Browser.BrowserHttpWebRequest.InternalEndGetResponse(IAsyncResult asyncResult)

   at System.Net.Browser.BrowserHttpWebRequest.<>c__DisplayClass5.<EndGetResponse>b__4(Object sendState)

   at System.Net.Browser.AsyncHelper.<>c__DisplayClass2.<BeginOnUI>b__0(Object sendState)

   --- End of inner exception stack trace ---

   at System.Net.Browser.AsyncHelper.BeginOnUI(SendOrPostCallback beginMethod, Object state)

   at System.Net.Browser.BrowserHttpWebRequest.EndGetResponse(IAsyncResult asyncResult)

   at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelAsyncRequest.CompleteGetResponse(IAsyncResult result)

   --- End of inner exception stack trace ---

   at System.ServiceModel.Channels.Remoting.RealProxy.Invoke(Object[] args)

   at proxy_2.EndLimitRecords(IAsyncResult )}



After some perseverance and research done by Marc, he figured out that the problem was due to the size of the data we were returning and the default RIA services settings...  The problem was resolved by adding the following element to the config file:



    <client />

    <serviceHostingEnvironment aspNetCompatibilityEnabled="true"

      multipleSiteBindingsEnabled="true" />


      <service name="UILoadTest.Web.TestService"

   behaviorConfiguration="RIASvcBehavior">  </service>




        <behavior name="RIASvcBehavior">

          <serviceMetadata httpGetEnabled="true" />

          <serviceDebug includeExceptionDetailInFaults="True" />

          <dataContractSerializer maxItemsInObjectGraph="655360"/>






        <binding name="BinaryHttpBinding">


            <readerQuotas maxDepth="32" maxStringContentLength="888192" maxArrayLength="2147483647"

              maxBytesPerRead="2147483647" maxNameTableCharCount="16384" />


          <httpTransport maxReceivedMessageSize="2147483647" maxBufferSize="2147483647" />







Hope this will save some troubleshooting time to some of you…




Comments (3)

  1. JGN says:

    Thanks very much, it solved my major issue with WCF

  2. Johan says:

    Thanks, this solved my issue with passing a large binary parameter to my webservice.

  3. PIE says:

    Thanks for your help, I searched lot of article related to this error and finally I am able to resolved it through your code. Thanks a ton.

Skip to main content