Click here to Skip to main content
15,912,578 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have created a Business object which contains around 40-45 properties. I have a question that what is the limit of business object with respect to WCF. As my BO will be called through WCF, so how much data will that support. As all properties may have value when called through WCF
Posted
Updated 12-Aug-11 1:18am
v2

Normally communcation between you service and client in the form of XML, so data size is main thing.

In WCF we can configure how much the size data to trnasfer from server to client.
using Binding element you can set.using maxReceivedMessageSize or using readerQuotas. Please refer microsft site for details
http://msdn.microsoft.com/en-us/library/ms731361.aspx

Example:

C#
<wshttpbinding>
 <binding name="WSHttpBinding_Service" closetimeout="10:15:00">
     openTimeout="00:30:00" receiveTimeout="10:15:00" sendTimeout="10:15:00" bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard"
     maxBufferPoolSize="524288" maxReceivedMessageSize="2147483647" messageEncoding="Text"
     textEncoding="utf-8" useDefaultWebProxy="true" allowCookies="false">
     <readerquotas maxdepth="32" maxstringcontentlength="2147483647" maxarraylength="2147483647">
      maxBytesPerRead="4096" maxNameTableCharCount="16384" />
     <reliablesession ordered="true" inactivitytimeout="10:15:00">
      enabled="false" />
</reliablesession></readerquotas></binding>
</wshttpbinding>
 
Share this answer
 
Comments
Anuja Pawar Indore 12-Aug-11 7:12am    
2147483647 means 2 GB. So u trying to say that will support around 2GB data
senthil sennu 12-Aug-11 7:24am    
I dint test yet. For that attribute, Max value is that one.
Also you can Specify <datacontractserializer maxitemsinobjectgraph="10485760"> in the serviceBehaviors/behavior tag. Hope this helps you.
Anuja Pawar Indore 12-Aug-11 9:56am    
Thanks yes it did helped :)
Got a very easy was to calculate the size of business object at run time

BinaryFormatter bf = new BinaryFormatter();
MemoryStream ms = new MemoryStream();
bf.Serialize(ms, YourBusinessObject);
return ms.ToArray();

What ever size this array will return, that will be the size of your business object.
 
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