views:

51

answers:

2

I can read the SP lists fine and pull data out of the SP context, but I am trying to get data from an external database as well and I don't know exactly how to do that. Is is possible to add WCF communication to the webpart that will allow the Silverlight app to communicate to a WCF service? If so, any examples on how to do this?

Or is there a better way to store/retrieve custom data that I don't want to be accessable through custom sp lists?

A: 

Eric,

I am not sure if i have understood your question correctly. If you have a custom webpart that loads some silverlight content and silverlight needs to access external data using wcf, then you can do the following:

  1. If you need to deploy your wcf service in sharepoint site, then follow this article from Sahil Malik: http://blah.winsmarts.com/2008-5-SharePoint_as_a_WCF_Host.aspx

  2. Once the service is deployed and your able to access it from ie, Add service reference in your silverlight project.

  3. Load the silverlight application in your webpart

This link might also help:

http://blah.winsmarts.com/2008-7-SilverLight_WCF_References_in_SharePoint_-_The_right_way.aspx

Faiz
+1  A: 

You could use a combination of BCS/External Content Types to surface the data in SharePoint, then the SharePoint client object model to access this.

Shaneo