Binary Encoding and Handling Faults in Silverlight 3
Monday, August 03 2009 - silverlight, wcf, faults, data-points, msdn-magazine
My Data Points column in the August 2009 issue of MSDN Magazine is now online,titled Data Performance and Fault Strategies in Silverlight 3. In this issue I demonstrate how binary encoding works, the effect it has on an application’s performance, and how it behaves by demonstrating it in action with Silverlight 3. I also walk through several techniques that can be used to pass exception information using undeclared and declared faults from Windows Communication Foundation (WCF) Web services to Silverlight.
I hope you enjoy it!

13 comment(s)
Jack ... sure is. Written completely with RTM bits!
perhaps it could be contributed to silverlightcontrib.codeplex.com
In this Issue: Ian T. Lackey ( 2 ), Shawn Wildermuth , David Anson , Jesse Liberty ( 2 ), Scott Marlowe
Great article! I got the Binary Encoding working but using the DataFaults is giving me some trouble. If I have ServiceBehavior(IncludeExceptionDetailInFaults = true) I get a FaultException<ExceptionDetail> rather than a FaultException<ServiceReference.DataFault>, while if I don't set the IncludeExceptionDetailInFaults I get (in case of a FaultException<DataFault> exception on the server) an error message: "The server was unable to process the request due to an internal error. For more information about the error, either turn on IncludeExceptionDetailInFaults ... etc.
I get the behavior as described above only for a (single) exception thrown during startup (in the page constructor). Later on everything works as described in the article. I cannot reproduce this in your SilverlightFaultData solution, however.
Anyhow, I'm fine. Thanks.
  Turing Project Page : [Novice: 8 | Advanced: 5 ]    FAQ Table of Contents What
  Turing Project Page : [Novice: 8 | Advanced: 5 ]    FAQ Table of Contents What
this is waffck
How can we modify the above solution (SilverlightFaultBehavior class) for a service written in Java? The client is still SL3.
Turing Project Page : [Novice: 8 | Advanced: 5 ] FAQ | Table of Contents | Definitions What is this and
Everything seems to be working, except for one hold-up. I am getting error message that when I monitored fiddler was caused by the response being Content-Length: 0 and Connection: close.
When I attach to the silverlight fault behavior, it runs through the code as it should.
Any ideas?
In case anybody faces the same problem, I turned on WCF tracing and found that it didn't have KnownType on RuntimeType and since I had a property on my Details object of type "System.Type", it didn't know how to serialize it.
Lesson to be learned, don't make a property of type "System.Type".






Is this still all relevant in the RTM version? I haven't seen much puclished outside of the context of SL3 beta.
All the functionality you are referencing is still in the RTM?
thx