0

I'm calling a WCF operation and was running into the classic circular reference issue where my primary object (Persons) included a reference to another object (Reminders) which I need to contain a reference back to Persons. I fixed this using ReferencePreservingDataContractFormatAttribute (documented well online if you Bing it). And the fix works great for calling my service from my website project. When I attempt to call it from WCFTestClient, however, I get a Stackoverflow Exception. If I take off my .Include("Person") in my service operation then it works just fine in both. Does anyone have any ideas why this might happen? I compared the serviceModel sections of the config files to be sure there were no significant differences. Thanks for any ideas you can provide.

Jeremy Foster
  • 4,405
  • 2
  • 24
  • 44
  • 1
    Is it possible that the WCF test client is attempting to follow the circular references in order to print out the values of properties? – Brian Rogers Jan 21 '12 at 01:35
  • That's about what I was suspecting. Thank you. I'll see if there are any config tweaks in WCTTestClient that will help. – Jeremy Foster Jan 24 '12 at 18:17
  • Have not found any tweaks. Config files are identical. This is a bummer. – Jeremy Foster Jan 25 '12 at 08:42
  • You might be out of luck. Here's another nearly identical [question](http://stackoverflow.com/questions/8686960/wcftestclient-exe-not-able-to-handle-circular-reference); the advice there was "test with your own client". – Brian Rogers Jan 25 '12 at 17:30

1 Answers1

0

Keeping in mind that it works from your website project but not from your test client there are 3 possibilities:

  • You have not updated the service reference in your test client (9 times out of 10 that is the problem)
  • There is some other bug in your test client
  • The call from your test client uses different parameters and is therefore returning different data.
Shiraz Bhaiji
  • 60,773
  • 31
  • 133
  • 239