views:

55

answers:

1

Hi all,

Im my current project we need to interface with sharepoint to store and retrieve various documents.

This has previously been done by referencing the Microsoft.Sharepoint dlls directly and going from there. As I don't know a lot about sharepoint yet I have been doing some research.

Most of the examples I find actually refer to using the Sharepoint web services themselves (the various vti_bin ones shown in http://www.sharepointmonitor.com/2007/01/sharepoint-web-service/).

I cant seem to find the differences in approaches. This current project was written a few years ago so maybe the web services weren't available then?

I'm looking for a solution to add and retrieve data from sharepoint and also a little explanation as to the differences in using refernces vs the web service

Cheers

+2  A: 

Referincing Microsoft.SharePoint.DLL is only supported on code that runs within SharePoint. It often does work on Projects that are not part of SharePoint but that are run on a SharePoint server, but that's a) unsupported and b) not all functions work. If your Applications runs outside of the SharePoint server, referencing Microsoft.SharePoint.dll won't work.

If you want to access SharePoint from an application outside of SharePoint, there's three ways:

  1. Use the SharePoint Webservices, for example Lists.asmx
  2. If your SharePoint site runs on SharePoint 2010, use one of the three Client Object Models (.net, Silverlight, JavaScript)
  3. Develop some code that runs on the SharePoint Server and exposes the data through a Web Service. This only makes sense if you have to do something that's either complicated/painful to do entirely client side or if you really need full control over the web service.
Michael Stum