WCF and Silverlight debugging

As part of my latest updates to my current project, I made a change to the underlying WCF service that provides much of the information to our Silverlight application. In one of my DataContract classes, I started passing a child class to one of its DataMembers (i.e. the DataMember is a property on Foo, I passed in a Bar which is a subclass of Foo). Then, when Silverlight called the asynchronous version of that method, I started getting an ambiguous error: "The remote server returned an error: NotFound"

I stepped through both the Silverlight side and my WCF side - no errors apparent either place. However, just after the return statement in WCF and method exit, the Silverlight's service reference would pop up the "NotFound" error. Strange, I thought... what's the problem?

Other web searched seemed to direct me to update the buffer size, to delete and re-add the service reference, all to no avail. Finally, I changed the type on my datacontract's datamember to be the subclass instead of the parent class. Voila! Like magic, everyone's happy again. I'm not certain of the mechanics behind this failure- it seems like it should be allowable. In any case, if you hit this error, check the types on your data members as well - see if there's a more specific class you could be using instead.

Comments

Popular posts from this blog

Managing to Lead

Process Consensus

Cert-ifiably IISane