by
Roland Schumacher alias GENiALi
3. Februar 2010 -- 263
words -- 1 mal gelesen
At the time I may work on a large project that use rain of WCF makes. All communication between server and client is based on WCF.
Now, I've been looking some time on an error in which the message was pretty misleading, showed how now.
The error message is something like this (truncated):
"System.ServiceModel.CommunicationObjectFaultedException" was caught.
"Message ="The communication object \"System.ServiceModel.Security.SecuritySessionClientSettings'1+ClientSecurityDuplexSessionChannel[System.ServiceModel.Channels.IDuplexSessionChannel]\" cannot be used to communicate because it is in the faulted state. "
When I now watch me the message I think to myself, that seems to be but a problem with the security. Quite classic. Permissions on a resource, any either way.
Far from. Has to do with this certainty. There are still other security in the WCF. She attacks against DoS (denial of service). In other words, certain limits are defined in the WCF which shall not be exceeded / can. This is for example the maximum message size (maxReceivedMessageSize). Limited by default to 65'536 bytes. That is not much ago my scenario. When I raised this value no longer was the error message.
What struck me this, the setting must be made only on the client side. On the server side, I could let everything be so as before. Here a bit of code as it can be made.
private static T BindEndpoint < T >(string_endPointAdress)
where T: class
{
EndpointAddress endpoint = new EndpointAddress(endPointAdress);
}NetTcpBinding binding = new NetTcpBinding();
binding.MaxReceivedMessageSize = 10485760;
ServiceClient < T > client = new ServiceClient < T, >(binding,_endpoint);
return (T) client.{InnerChannel;
}The method we 1 to 1 copy not just work. The relevant part can be found in line 7. The message size can be thus about 10 MB.

38c6c32c-d896-4097-8d33-5cc345137899|0|.0
Tags: