Thursday, February 21, 2008

DataContractSerializer.MaxItemsInObjectGraph in WCF

There are several things that control a huge list returned from a WCF call. DataContractSerializer.MaxItemsInObjectGraph, Binding.maxBufferSize, and Binding.maxReceivedMessageSize are commonly used.

According to SDK, DataContractSerializer.MaxItemsInObjectGraph = the maximum number of items in an object graph to serialize or deserialize.
NetTcpBinding.MaxReceivedMessageSize = the maximum size for a received message that is processed by the binding.
NetTcpBinding.MaxBufferSize = a value that specifies the maximum size, in bytes, of the buffer used to store messages in memory.

The default value for all three setting is 65,536. You can tweak this number to support large returned lists.

One thing that you should know is that TheNumberYouSet != MaxListCountExpected. TheNumberYouSet should be far bigger than MaxListCountExpected because of this "graph" thing.

To add a DataContractSerializer.MaxItemsInObjectGraph , you create an endpoint behavior (rather than a service behavior), and add the behavior to the endpoint (not at the service level).

Wednesday, February 20, 2008

SQL Server Remote Connection between XP server and Vista server

I got the following link from a coworker.

The Microsoft UI Automation Library

The Microsoft UI Automation library is included in the .NET Framework 3.0 as part of Windows Presentation Foundation (WPF). Read Dr. James McCaffrey's article The Microsoft UI Automation Library in more details.