Silverlight Client Object Model, mysterious errors

Tags: Development, SharePoint 2010, Silverlight, Windows 7, Client Object Model

So in the tech preview version of SP 2010 that I'm working with, the Client Object Model (ClOM)is kind of tricky to get working.  You'll find the basic steps in getting it configured over the last couple posts on this space; but there was one thing I didn't think of: clientaccesspolicy/crossdomain

I've done quite a bit of Silverlight Development in SP2007, so getting the XDomain.xml file in there was nothing new to me.  The trick was the fact that the Call to the ExecuteQuery method on the ClOM would return a failure state, but the FailureArguments were always empty--no message, no stack trace, or anything.  One of the nice things about Silverlight (or any Service-based) development is the number of debugging and diagnostic tools at your disposal--its easy to isolate the module/component/layer that is giving your application problems.  In this case, I wanted to look at the requests back and forth between my Silverlight app and the ClientContext, which I knew was implemented through a WCF interface.  Fiddler showed me that the crossdomain.xml file was being requested with a 404 (not found) response from the server.  It also showed me exactly where the XDomain file needed to go to get it working!  Once I fired up SPD2010 and created my xml file in the root site, everything was working charmingly.  And fiddler even showed me that too: (finally took a screener of that)

 

BTW, if the SL app i was debugging was actually deployed to the SP Site itself, the XDomain policy wouldn't even be in play b/c SL would be speaking within the same internet domain.

Once I get the demo a little more interesting, I'll post some notes around it.

Add a Comment