Feed
Google+
Contact
XING
LinkedIn
Twitter
ICQ
meebo.com

WCF - misleading error message

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.

kick it on dotnet-kicks.de

Tags:

Kommentare sind geschlossen

Statistik

Gesamte Posts: 1025
Dieses Jahr: 7
Diesen Monat: 1
Diese Woche: 0
Kommentare: 929
Total Bewertungen: 91
Ø Bewertung: 4,42
Meisten Kommentare
Google+ ... (28)
Beste Ø Bewertung
Tastaturlayout von Visual Stud ... (5)
Meiste Bewertungen
Windows 7 und die ersten Erfah ... (5)

Buttons

Stop Spam Harvesters, Join Project Honey Pot Benutzerprofil von GENiALi connection speed test network connection Bloggeramt.de Slug.ch Blog Verzeichnis und Blog Webkatalog Schumacher Roland Seitwert Valid XHTML 1.0 Transitional

writing