Today I spent about half an hour banging my head against this problem:
Whenever I would try and return a business object, I’d simply get no response from my WCF Service. Litterally nothing.
The problem turned out to be that I had accidentally specified the DataMember Name of a property in a sub object twice.
So, I had my broken class set up like:
[DataContract(Name = "MyClass", Namespace = "Example")]
public partial class MyClass
{
[DataMember(Name = "property1")] public int Property1 { get; set; }
[DataMember(Name = "property1")] public string Property2{ get; set; }
}
An instance of this class was used as a property in another object, which was being returned from WCF.
.NET didn’t throw any sort of error unless I tried to return just “MyClass”.
Sure, it was my fault, but if you have a complex data structure, this could get awefully difficult to find without some sort of message from WCF.
Yes, this is part of that ultra nifty WCF JSON .NET 3.5 Flex project at work. ![]()

One Comment
[...] me, the first time this happened to me, it was because I had stuffed up the DataMember Name values. It has also occurred for other reasons, such as a property not being populated, when I had [...]
March 16th, 2008 at 12:10 am. Permalink.