Error while passing large data from RIA service to Silverlight

Answered Error while passing large data from RIA service to Silverlight

  • Wednesday, September 15, 2010 6:11 AM
     
     

    Hello All,

     

    When passing large data from RIA service to Silverlight , the load operation failed with an exception.

    Can anyone tell me how to

    1.  Increase the  reader quota  values

    2.  Custom binding binary message encoding  for RIA service in the configuration file at server side(web.config) and  Silverlight application( there is no .clientconfig file for RIA)

    3. Change binding configuration to pass more records

    4. Increase idle timeout of RIA service which is deployed in cloud with authentication="none" & ADFS integrated.

     

    I think answers to these questions will help solve my problem.

     

    Thanks,

    Deepthi

All Replies

  • Sunday, September 19, 2010 8:00 PM
     
     

    I have very same problem with RIA services.

    I need to retrieve big chunk of data and I can not increase buffer and message size limit in client side.

    Appreciate any help.

    Thanks.

    Irina

     

  • Sunday, September 19, 2010 8:27 PM
     
     

    something like this in your web.config ?


        <behaviors>
          <serviceBehaviors>
            <behavior name="Project-Web-MyDomainServiceBehaviour">
              <serviceMetadata httpGetEnabled="true"/>
              <serviceDebug includeExceptionDetailInFaults="true"/>
              <dataContractSerializer maxItemsInObjectGraph="2147483647"/>
            </behavior>
          </serviceBehaviors>
        </behaviors> 

    change the name of the behaviour to your projects domain service behaviour name

  • Monday, September 20, 2010 12:33 AM
     
     

    I tried it but it didn't help.

    The problem, I think, that I need to configure receiving data in ServiceReference.ServiceConfig file (client side) as well as sending data in Web.config like you show above in service side but I can not create ServiceReference along with ServiceReference.ServiceConfig file since I use RIA service.

    Thanks.

    Irina

  • Monday, September 20, 2010 8:40 AM
     
     

    i had the same issue and the change i posted fixed it for me. I was creating a large csv file that was downloaded and it wouldnt work for large files until i made that change.

    do a google search with the error message you are getting that is how i found my solution

    mike

     

  • Monday, September 20, 2010 8:46 AM
     
     
    <configuration>
     
    <system.web>
       
    <compilation debug="true"
                     
    targetFramework="4.0" />
       
    <httpRuntime maxRequestLength="40960"/> <!--this is important-->
     
    </system.web>

     
    <system.serviceModel>
       
    <services>
         
    <service name="SilverlightApplication1.Web.Service1">
           
    <endpoint address=""
                     
    contract="SilverlightApplication1.Web.IService1"
                     
    binding="basicHttpBinding" />
         
    </service>
       
    </services>
       
       
    <behaviors>
         
    <serviceBehaviors>
           
    <behavior >
             
    <serviceMetadata httpGetEnabled="true" />
             
    <serviceDebug includeExceptionDetailInFaults="true" />
           
    </behavior>
         
    </serviceBehaviors>
       
    </behaviors>
       
       
    <bindings>
         
    <basicHttpBinding>
           
    <binding  maxReceivedMessageSize="2147483647"> <!--this is important-->
              <readerQuotas
                maxDepth="64"
                maxArrayLength="2147483647"
    <!--this is important-->
                maxBytesPerRead="4096"
                maxNameTableCharCount="16384"/>
           
    </binding>
         
    </basicHttpBinding>
       
    </bindings>
       
       
    <serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
     
    </system.serviceModel>
     
     
    <system.webServer>
       
    <modules runAllManagedModulesForAllRequests="true"/>
     
    </system.webServer>
    </configuration>
  • Tuesday, September 21, 2010 4:26 PM
     
     Answered

    Hello all,

    Now it works for me.

    Code from the last post didn't work until I configure behaviors section like this:

         <behaviors> 

             <serviceBehaviors> 

                 <behavior> 

                     <serviceMetadata httpGetEnabled="true"/> 

                     <serviceDebug includeExceptionDetailInFaults="true"/> 

                     <dataContractSerializer maxItemsInObjectGraph="2147483647"/>  <!--this is important-->
      

                 </behavior> 

             </serviceBehaviors> 

         </behaviors>

     

    Thank everybody.

    Irina

     

     

     

  • Friday, September 23, 2011 12:35 AM
     
     
    In my case i am uploading a file of 1MB and convertin it to byte array and trying to save it to the SQL database through the WCF RIA Serice. Getting error message "The time allotted to this operation may have been a portion of a longer timeout." I tried everything mentioned above but not working. Can anyone help. Thank you Hrushikesh
  • Monday, November 28, 2011 3:28 AM
     
     

    Getting error message "The time allotted to this operation may have been a portion of a longer timeout."


    Inroder to change teh timeout you can take a look here http://blogs.msdn.com/b/kylemc/archive/2010/11/03/how-to-change-the-request-timeout-for-wcf-ria-services.aspx

    Hope it helps

  • Friday, February 17, 2012 5:51 PM
     
     

    Irina,

    While the solution above by itself did not work for me (pulling 3400+ records into my Silverlight app via WCF RIA), setting the maxItemsInObjectGraph for dataContractSerializer did work just fine.  Thank you for the solution!

    -VK.

  • Wednesday, March 07, 2012 9:58 AM
     
     

    Hi All,

    Its working fine in local system only. If access my application in remote system not working. I did two changes in web config file.

    <serviceDebug includeExceptionDetailInFaults="true"/>
    <dataContractSerializer maxItemsInObjectGraph="2147483647"/>

    Really its very important to fix this issue early. Please any one share found the solution for this.

    Thanks

  • Thursday, April 19, 2012 11:18 PM
     
     

    Big thanks....  I was looking for that since few days!   Laughing

  • Friday, April 20, 2012 12:18 AM
     
     

    Hi... Could you share your issue and which one was help to fix this. Because Its working fine in localhost. If access my application in www.xxxxx.xom(remote system) not working. I did two changes in web config file.

  • Monday, May 14, 2012 6:51 AM
     
     

    [Query(IsComposable = false, ResultLimit = 10)] 

    copy and paste the code up the domain service method.

  • Tuesday, May 22, 2012 8:57 AM
     
     

    Thanks a lot to ALL...!!! This consolidated solution  worked for me...!

    C H E E R S ! !

     

    Thanks,

    Jagdish

     

     

  • Tuesday, May 22, 2012 10:49 AM
     
     

    Thanks for ur suggestion... Could u plzz elabrate about u said. where i need to place that above code.