I\'ve run into a problem trying to return an object that holds a collection of childobjects that again can hold a collection of grandchild objects. I get an error, \'connect
did you specify in your service behavior config? it seems like some information is missing in this stacktrace.
can you grab the exception at server side (e.g. in visual studio debug mode or with a logging library like log4net).
have you tried calling some other methods (simple helloworld() e.g.) on the same service to be sure that the service configuration itself works? this kind of exceptino could also indicate some serialization problems. what types do you want to send over the wire? do you use KnownType's somewhere?
Try setting [OperationBehavior()]
above your implementation of the interface method.
Yep, I had the same problem here and it was todo with returning objects that had enum values in it. Changed the DataMember
to an int and everything statrted working.
Add this line into <system.web/>
:
<httpRuntime maxRequestLength="102400" executionTimeout="3600" />
Enums get a DataContract
attribute, like any class would, but the enum values aren't supposed to have DataMember
attributes on them.
Change them to EnumMember
and you'll stop getting this inscrutable error.
I have had the same problem too (.Net 3.5). Turns out my base class DataContract
was missing a known type. It's unfortunate that the WCF error was not more descriptive.