17

Click here to load reader

Silverlight3 WCF Exceptions

Embed Size (px)

Citation preview

Page 1: Silverlight3 WCF Exceptions

Silverlight 3 WCF Exceptions“Down the Rabbit Hole”

Presented byWilliam Austin

[email protected]

Page 2: Silverlight3 WCF Exceptions
Page 3: Silverlight3 WCF Exceptions
Page 4: Silverlight3 WCF Exceptions

Down the Rabbit Hole

Page 5: Silverlight3 WCF Exceptions

“Alice discovers during her travels that things are not what they seem”

Her experiences in Wonderland challenge her understanding of the world.

Page 6: Silverlight3 WCF Exceptions

Static Proxy file generation

WCF

Beh

avio

rs

WebDev Helper

IEndPoint BehaviorReference.cs

HTT

P Tr

affic

sni

ffin

g

Our Rabbit HoleClientAccessPolicy.xml

BehaviorE

xtensionElem

ent

IDispatchMessageInspector

basicHTTPBinding

The service returned an error : Not Found

Page 7: Silverlight3 WCF Exceptions

Code Demo #1

The Happy Path

Page 8: Silverlight3 WCF Exceptions

Summary of Demo

• Importance of clientaccesspolicy.xml• Default wsHTTPBinding

Page 9: Silverlight3 WCF Exceptions

Code Demo #2

Exceptions thrown on the WCF service side.

Page 10: Silverlight3 WCF Exceptions

• WCF FaultException<>• Modifying service, requires Update Service in

client.• Inspect HTTP traffic• Cast e.Error to FaultException<T>• …And it STILL doesn’t work.

Summary of Demo 2

Page 11: Silverlight3 WCF Exceptions

Code Demo 3

• Silverlight is hosted within the browser (mostly…)

Page 12: Silverlight3 WCF Exceptions

• Convert HTTP500 to HTTP200• WCF Behavior, web.config, dynamic • BehaviorExtensionElement,

IEndpointBehavior, and IDispatchMessageInspector are your friends.

Summary of Demo 3

Page 13: Silverlight3 WCF Exceptions

Lessons learned

• WCF FaultException<> and Silverlight3• BehaviorExtensionElement,

IEndpointBehavior, and IDispatchMessageInspector

• Silverlight runs within the browser

Page 14: Silverlight3 WCF Exceptions

Useful Article Links

Understanding WCF Faults in Silverlight 3

http://www.netfxharmonics.com/2009/07/Understanding-WCF-Faults-in-Silverlight-3

Consuming Web Services in Microsoft Silverlight 3

http://videos.visitmix.com/MIX09/T42F (beta 3.0, up to the 30:00 minute mark)

Creating and Handling Faults in Silverlight

http://msdn.microsoft.com/en-us/library/dd470096(VS.95).aspx

Page 15: Silverlight3 WCF Exceptions

Are you mad??

?

Page 16: Silverlight3 WCF Exceptions

“We’re all mad here…”

“If you weren’t mad, you

wouldn’t be here”

Page 17: Silverlight3 WCF Exceptions

Silverlight 3 WCF Exceptions“Down the Rabbit Hole”

Presented byWilliam Austin