
SharePoint 2013: Business Connectivity Services – Consuming OData in BCS using an App External Content Type
Author: Tobias Zimmergren
http://www.zimmergren.net | http://www.tozit.com | @zimmergren
Introduction
As most if not all of you already know, SharePoint 2013 and Office 2013 has been released to preview/beta and is available for download from Microsoft’s download centers. In this article I will briefly introduce some exciting changes that has been made to the SharePoint 2013 Business Connectivity Services framework. I’ve written a bunch of articles on BCS for SharePoint 2010, and now it’s time to continue that track and introduce the new features available in SharePoint 2013.
[blockquote]
Please note that this article is written for SharePoint 2013 Preview, and for the final version of SharePoint some details may have changed
- SharePoint 2013: Business Connectivity Services – Introduction
- SharePoint 2013: Business Connectivity Services – Consuming OData in BCS Using an App External Content Type
- SharePoint 2013: Business Connectivity Services – Talking to your external lists using REST
- SharePoint 2013: Business Connectivity Services – Client Object Model
- SharePoint 2013: Business Connectivity Services – Events and Alerts
[/blockquote]
SharePoint 2013 – BCS with OData
In this specific article we’ll be looking on how you can consume data from an Open Data protocol (OData) data source. Tag along for the ride!
First of all, tell me what OData is…!?
Right, so OData is a Web protocol for performing CRUD (Create Read Update and Delete) operations and utilizes technologies like HTTP, ATOM and JSON.
As quoted from the OData Web Site:
[blockquote]
The Open Data Protocol (OData) is a Web protocol for querying and updating data that provides a way to unlock your data and free it from silos that exist in applications today.
OData does this by applying and building upon Web technologies such as HTTP, Atom Publishing Protocol (AtomPub) and JSON to provide access to information from a variety of applications, services, and stores.
[/blockquote]
We can have lengthy discussions about how awesome (or unawesome) OData is but in this article we’ll be focusing on consuming OData data sources in SharePoint 2013 through Business Connectivity Services, one of my favorite parts of SharePoint.
Launch Visual Studio and get started!
So, as you probably could tell by the title of this post – you should now open Visual Studio 2012 :-)
Create the project
Choose the project type App for SharePoint 2013:
[
Looking in your Feature explorer, you can see that the default Feature now contains your artifacts along with the newly created List Instance and External Content Type:
[
In the newly created List Instances, the following XML has been generated for us:
As you can see, the ListInstance DataSource node contains information about connecting to our newly created BCS entity. Perfect.
Just to make sure that we can deploy our solution, hit F5 and make sure that VS2012 deploys your project properly
Validate that your application works
Navigate to your site and validate that your new App is properly deployed and showing:
[![SharePoint 2013 app]et/content/images/2012/08/image15.png)
Click the app and make sure you can see the result of your very basic and “hello world”-ish app:
[
Display your new external list!
Do you remember in one of the previous steps that I mentioned that you should leave the checkbox ticked in a dialog, saying “Create list instances for the selected data entries (except Service Operations).”? Well the reason for that is that we want Visual Studio 2012 tools to create this list for us so we don’t have to do that ourselves.
With the newly deployed BCS external content type app, with it’s created list, you can access the content of the list on the following URL (you’ll need to check your Elements.xml for your ListInstance element in order to find out your url:
Navigate to this URL and you’ll see this view:
[![SharePoint 2013 BCS et/content/images/2012/08/image16.png)
So that’s pretty cool and easy right? Straight from the XML-formatted OData source we’ve pulled some info into our App in SharePoint.
Summary
As you can see, working with SharePoint 2013 and the OData model with BCS is pretty straight forward. In this example I created an App for SharePoint utilizing the BCS framework to connect to an OData data source. I’m pretty impressed with the options this opens up for many of our existing SharePoint 2010 projects that sometime in the future will be upgraded to SharePoint 2013.
In the next few posts we’ll dive more into the news around BCS for SharePoint 2013.
Enjoy.
Recent comments