Click here to Skip to main content
15,899,474 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
I am trying to send huge data from WCF service to a silverlight application. I am trying to serialize the object in the WCF service and send it to the client but i am not able to deserialize it in the client side . Can any one please help me out with an example to do so.
Thanx
Posted
Comments
Pete O'Hanlon 12-Jul-11 13:20pm    
What do you mean by huge data? Are you talking about a huge number of records, or one really large data item? This has a real bearing on the answer you get.
Mark Salsbery 12-Jul-11 19:19pm    
Since you state you are able to get the serialized data to the client, then what is failing during deserialization?

Try playing around with the maxBufferSize in the servicesclient.config file see.
Maybe increasing the size can help you out.
 
Share this answer
 
You can try by changing settings in web.config of your WCF Service as below.


<bindings>                    
 <webhttpbinding>                           

<binding name="webHttpBindingConfig" maxreceivedmessagesize="2147483647" maxbufferpoolsize="2147483647">   

<readerquotas maxdepth="2147483647" maxarraylength="2147483647" maxbytesperread="2147483647" maxnametablecharcount="2147483647" maxstringcontentlength="2147483647" />                           

</binding>                                           

</webhttpbinding>             
</bindings>
 
Share this answer
 
v2
Hello,
Thanks guys. But i had tried all these and yet dint achive my goal. Tha only option remaining is to serialize the objesct while sending it and then deserializing it in the client side.
I found many examples to serialize it in the service but the challenge is to get that serialized stream and deserialize it in the client.
Can you please suggest any examples where serialization and deserialization is done .
Thanx
 
Share this answer
 
Hi all, i finally got some improvement in performance by adding this in my web.config

XML
<behavior name="SilverlightWCFLargeDataApplication.Web.SilverlightWCFServiceBehavior">
             <serviceMetadata httpGetEnabled="true"/>
             <serviceDebug includeExceptionDetailInFaults="false"/>
             <dataContractSerializer maxItemsInObjectGraph="2147483647"/>
         </behavior>
    </serviceBehaviors>
</behaviors>


hope it helps me to achive my goal.
Can any one please suggest any other better way.
Thanx
 
Share this answer
 
HI,
the code pasted in the above post is the best solution to transfer huge data from WCF service to Silverlight application.
I was able to send 2 million record from my service to client.
Thanx
 
Share this answer
 
Split data into multiple fragments, then reassemble on the silverlight side.

This will avoid a lot of deployment problems, and may even be more efficient.

Best regards
Espen Harlinn
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900