views:

164

answers:

1

I am wondering how to access facebook api best using Silverlight.

Right now i am developing a silverlight(+ria services) app for facebook.

I see 2 possibilities:

1) Access facebook api using the facebook developer kit for silverlight (Facebook.Silverlight.dll)

2) Create a service class on Server Side which acts as a wrapper for easy facebook api access (Facebook.Web.dll)

Thanks for your help

+1  A: 

You should create a service class on your Server Side that calls the Facebook API, then call your service from your Silverlight client.

Client browser security in general (and therefore Silverlight) means you can't make a cross-domain call in this case from your Silverlight client to an external site unless Facebook provides a "clientaccesspolicy.xml" file.

Have a look here for more: http://msdn.microsoft.com/en-us/library/cc645032%28VS.95%29.aspx

Peter McGrattan
Actually i already tried sucessfully to access the facebook api with the first method. But it seems not like the best way. I think it would be a better way to make a Service Wrapper for that case.
Ben
@Ben: I don't doubt it, as I said it's possible if they provide a clientaccesspolicy.xml (or crossdomain.xml) file. From a security and general application design/management point of view it would indeed still be better to make a Service wrapper.
Peter McGrattan
@peter... could you elaborate on how to make that wrapper? Ria-services seems to shine if you use a database directly, but I can't find examples of how you would make a proxy service.
Toad