I have a WCF web service that is working fine. However there is one particular call that is failing - but only failing for certain users. The call is pretty simple - it is
I just had this error now in server only and the solution was to set a maxItemsInObjectGraph
attribute in wcf web.config
under <behavior>
tag:
<dataContractSerializer maxItemsInObjectGraph="2147483646"/>
I have catched the same exception and found a InnerException: SocketException.
in the svclog trace.
After looking in the windows event log I saw an error coming from the System.ServiceModel.Activation.TcpWorkerProcess
class.
Are you hosting your wcf service in IIS with netTcpBinding and port sharing?
It seems there is a bug in IIS port sharing feature, check the fix:
My solution is to host your WCF service in a Windows Service.
The best thing I've found for diagnosing things like this is the service trace viewer. It's pretty simple to set up (assuming you can edit the configs):
http://msdn.microsoft.com/en-us/library/ms732023.aspx
Hope this helps.
I have seen this once. Are the users requesting different amounts of data? I found that even if you can configure a binding for data payloads (i.e. maxReceivedMessageSize
), the httpRuntime
maxRequestLength
trumps the WCF setting, so if IIS is trying to serve a request that exceeds that, it exhibits this behavior.
Think of it like this:
If maxReceivedMessageSize
is 12MB in your WCF behavior, and maxRequestLength
is 4MB (default), IIS wins.
The issue I had was also with serialization. The cause was some of my DTO/business classes and properties were renamed or deleted without updating the service reference. I'm surprised I didn't get a contract filter mismatch error
instead. But updating the service ref fixed the error for me (same error as OP).
I' ve got the same problem. My solution is this :
If you using LinQ2SQL in your project, Open your dbml file in Visual Studio and change Serialization Mode to "Unidirectional" on