ODATA
I have written an article on the CodeProject describing the Composite Data Service Framework project, the article is at:
http://www.codeproject.com/KB/WCF/compdataserviceframework1.aspx
Please have a look and get involved with suggestions via the 'Discuss' page of the CDSF homepage, http://cdsf.codeplex.com/.
If you are struggling to fetch data from a Sharepoint OData service and getting an error as below:
[DataServiceClientException: Unauthorized] System.Data.Services.Client.QueryResult.Execute() +436914 System.Data.Services.Client.DataServiceRequest.Execute(DataServiceContext context, QueryComponents queryComponents) +133 Then ensure you are setting the Credentials property of your Data Service Context, as below:
// Create the data context. SharepointDataContext dc = new SharepointDataContext(new Uri("http://dksp/_vti_bin/listdata.svc")); // Provide default credentials, without this authorisation will fail! dc.Credentials = System.Net.CredentialCache.DefaultCredentials;
// Etc… var accounts = from a in dc.
Read more
Well this little issue took me a while to investigate, but the skinny is this:
If you are going to add a service reference to a Sharepoint OData service (e.g. http://sharepoint/_vti_bin/listdata.svc) then make sure your Sharepoint site name does NOT begin with a number - otherwise Visual Studio will fail to add the reference.
Quick and easy, but this took quite a while for me to find, hope it helps anyone in the same situation!
Read more