<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>WCF Data Services on dwmkerr.com</title><link>https://dwmkerr.com/categories/wcf-data-services/</link><description>Recent content in WCF Data Services on dwmkerr.com</description><generator>Hugo -- gohugo.io</generator><language>en-uk</language><managingEditor>Dave Kerr</managingEditor><copyright>Copright &amp;copy; Dave Kerr</copyright><lastBuildDate>Wed, 09 Nov 2011 15:49:00 +0000</lastBuildDate><atom:link href="https://dwmkerr.com/categories/wcf-data-services/index.xml" rel="self" type="application/rss+xml"/><item><title>IDataServiceMetadataProvider Entities Missing in $metadata</title><link>https://dwmkerr.com/idataservicemetadataprovider-entities-missing-in-metadata/</link><pubDate>Wed, 09 Nov 2011 15:49:00 +0000</pubDate><guid>https://dwmkerr.com/idataservicemetadataprovider-entities-missing-in-metadata/</guid><description>&lt;p&gt;If you are following through the example on creating custom data service providers as on this blog:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blogs.msdn.com/b/alexj/archive/2010/01/08/creating-a-data-service-provider-part-3-metadata.aspx"&gt;http://blogs.msdn.com/b/alexj/archive/2010/01/08/creating-a-data-service-provider-part-3-metadata.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;And you notice that your entities are not showing up in the $metadata file, double check that you have added this:&lt;/p&gt;
&lt;pre class="brush: c-sharp;"&gt;public class service : MyNewDataService
{
// This method is called only once to initialize service-wide policies.
public static void InitializeService(DataServiceConfiguration config)
{
config.SetEntitySetAccessRule("*", EntitySetRights.AllRead);
config.DataServiceBehavior.MaxProtocolVersion = DataServiceProtocolVersion.V2;
}
}&lt;/pre&gt;
&lt;pre class="brush: c-sharp;"&gt;Just remember to set the entity set access rules for all entities - other they won't show up!&lt;/pre&gt;</description><category>CodeProject</category></item><item><title>Composite Data Service Framework</title><link>https://dwmkerr.com/composite-data-service-framework/</link><pubDate>Wed, 09 Nov 2011 11:02:00 +0000</pubDate><guid>https://dwmkerr.com/composite-data-service-framework/</guid><description>&lt;p&gt;Today I start a new project - the Composite Data Service Framework.&amp;nbsp;The Composite Data Service Framework is a project that aims to obviate some of the limitations of WCF Data Services, specifically:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Allowing multiple data services to be aggregated in a single data service.&lt;/li&gt;
&lt;li&gt;Providing more support for Service Operations (such as auto-generation of proxies client-side).&lt;/li&gt;
&lt;li&gt;Aggregating different service types (entity framework, CLR types etc)&lt;/li&gt;
&lt;li&gt;Complementing OData services with traditional WCF services with a single definition of proxies client-side.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The project is in its early stages and is hosted at:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://cdsf.codeplex.com/"&gt;http://cdsf.codeplex.com/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;More updates will follow.&lt;/p&gt;</description><category>CodeProject</category></item><item><title>Data Service Exception "Unauthorised" when connecting to Sharepoint OData</title><link>https://dwmkerr.com/data-service-exception-unauthorised-when-connecting-to-sharepoint-odata/</link><pubDate>Wed, 02 Nov 2011 10:28:00 +0000</pubDate><guid>https://dwmkerr.com/data-service-exception-unauthorised-when-connecting-to-sharepoint-odata/</guid><description>&lt;p&gt;If you are struggling to fetch data from a Sharepoint OData service and getting an error as below:&lt;/p&gt;
&lt;pre&gt; [DataServiceClientException: Unauthorized]
System.Data.Services.Client.QueryResult.Execute() +436914
System.Data.Services.Client.DataServiceRequest.Execute(DataServiceContext context, QueryComponents queryComponents) +133&amp;nbsp;&lt;/pre&gt;
&lt;p&gt;Then ensure you are setting the Credentials property of your Data Service Context, as below:&lt;/p&gt;
&lt;pre class="brush: c-sharp;"&gt;// Create the data context.
SharepointDataContext dc = new SharepointDataContext(new Uri("http://dksp/_vti_bin/listdata.svc"));
&lt;p&gt;// Provide default credentials, without this authorisation will fail!
dc.Credentials = System.Net.CredentialCache.DefaultCredentials;&lt;/p&gt;
&lt;p&gt;// Etc&amp;hellip;
var accounts = from a in dc.Accounts select a;&lt;/pre&gt;&lt;/p&gt;
&lt;p class="brush: c-sharp;"&gt;Just another issue you may come across when using Sharepoint OData services!&lt;/p&gt;</description><category>CodeProject</category></item><item><title>The "Name attribute is invalid" when adding a Service Reference to a Sharepoint OData Service</title><link>https://dwmkerr.com/the-name-attribute-is-invalid-when-adding-a-service-reference-to-a-sharepoint-odata-service/</link><pubDate>Wed, 02 Nov 2011 10:19:00 +0000</pubDate><guid>https://dwmkerr.com/the-name-attribute-is-invalid-when-adding-a-service-reference-to-a-sharepoint-odata-service/</guid><description>&lt;p&gt;Well this little issue took me a while to investigate, but the skinny is this:&lt;/p&gt;
&lt;p&gt;If you are going to add a service reference to a Sharepoint OData service (e.g.&amp;nbsp;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.&lt;/p&gt;
&lt;p&gt;Quick and easy, but this took quite a while for me to find, hope it helps anyone in the same situation!&lt;/p&gt;</description><category>CodeProject</category></item></channel></rss>