How to Create External Content Type Using WCF Service

In this article we will be seeing how to create an external content type using WCF Service.

External content type can be created in various ways. In this we will be creating a WCF service and using SharePoint Designer 2010 we will be creating the external content type with ReadList and ReadItem operations. Check my previous article "How to create WCF service to retrieve data from the Oracle database" to create the WCF service which we will be using to create the external content type here.

Steps Involved:

I. Open the SharePoint Designer 2010.


ii. Click on Open Site.

iii. Enter the URL of your SharePoint site.

iv. Click OK.

v. Your SharePoint site will be opened in the Designer.

vi. In the Navigation, click on External Content Types.


vii. In the ribbon, click on External Content Type.


viii. In the External Content Type Information enter the Name as ECTUsingWCF.


ix. Click on "Click here to discover external data sources and define operations".

x. In the External Data Source Type Selection choose the Data Source Type as WCF Service and click OK.


xi. Click on Add Connection.


xii. In the WCF Connection wizard enter the WCF service url in the service metadata url and in the service endpoint url enter


xiii. Click OK; the WCF connection will be established and you will see the methods that we have created in the WCF service.


xiv. Now we are going to create ReadList and ReadItem operations.

xv. Right click on getEmployees and select New Read List Operation.


xvi. In the Read List wizard map Employee_ID to identifier.


xvii. Click Finish.

xviii. Right click on getEmployeesbyID and select New Read Item Operation.


xix. In the Read Item wizard map Employee_ID to identifier.


xx. Click Finish.

xxi. In the External Content Type Connections you will see the operations we have created.


xxii. Save the external content type.