PatTech
PatTech

Reputation: 397

More Complex Data Types in WCF, Association Attribute, Include Attribute etc

I have found this question: Complex data types in WCF? which has a very similiar problem, except it's based on enumvalue problems. My problem is a little more complex. I have a service with methods that function perfectly fine, except for one. The one method (operationcontract) call that fails is for a method returning a complex object. This object has a property with the [Include] and [Association] fields, which in turn has its own [Include] and [Association] fields (these are actually recursive, pointing to each other, buildiing a potentially infinite list.

The biggest problem is that in my development environment Win 7 x64, vs2010, iis, it functions as expected, but in my production environment Server 2008 R2, it breaks, giving me the "An error occurred while receiving the HTTP response to" error.

I have checked the Service Trace Viewer on the message log, but all that is apparant is that there is no response being sent at all for that particular request. All other requests get a "ServiceLevelSendReply" Record, whereas this particular method does not.

Any Ideas?

Upvotes: 0

Views: 589

Answers (1)

Allon Guralnek
Allon Guralnek

Reputation: 16131

Since you have objects referencing other objects in a possible circular manner, you're basically attempting to send an object graph rather than an object tree. WCF only added support for sending object graphs in .NET 3.5 SP1, so if your server has .NET 3.5 without SP1 or lower, it will fail when attempting to send an object graph.

To figure out exactly why your service isn't responding, you may want to enable WCF tracing which produces a very detailed log of what's going on inside your service.

Upvotes: 1

Related Questions