WCF DataContract deserializing complex types

I have a service that returns a collection of MyClass objects. If all instances of MyClass are null in MyClass2Reference, everything works fine. Otherwise, a "Connection reset" message appears on the client side. What am I doing wrong?

[DataContract]
public MyClass
{
[DataMember]
int ID;
[DataMember]
MyClass2 MyClass2Reference;
}

[DataContract]
public MyClass2
{
[DataMember]
int ID;
[DataMember]
string Name;
}

      

0


source to share


2 answers


Solved - This is an issue with NHibernate lazy proxy objects .



0


source


I think adding some tracing to your WCF config and then triggering the results through Service Trace Viewer as described here



would give a good description of the error. I've found this is always a good place to start when you run into strange WCF errors.

0


source







All Articles