How to: Create an External Content Type Based on a WCF Endpoint

Applies to: SharePoint Server 2010

The External Content Type Designer in Microsoft SharePoint Designer 2010 supports creating external content types that connect to Windows Communication Foundation (WCF) services. You can simply discover your WCF service and point to the bindings and contracts that will perform the desired operations, and use it to create your external content type without writing any code or XML. The procedure to create an external content type that connects to a WCF service is similar to one that connects to a Web service. The Code Sample: AdventureWorks2008 WCF Service provided in the SDK mirrors the Code Sample: AdventureWorks2008 ASP.NET Web Service.

Prerequisites

  • Microsoft SQL Server 2008 installed on the server running Microsoft SharePoint Server 2010.

  • Microsoft SharePoint Designer 2010 and Microsoft .NET Framework 3.5 installed on the client computer.

  • The Code Sample: AdventureWorks2008 WCF Service provided with this SDK deployed on a Web server.

Creating an External Content Type Based On a WCF Service

To create an external content type based on a WCF service

  1. Open SharePoint Designer and follow the steps described in How to: Create an External Content Type Based on a Web Service to create an external content type. Except for the procedure "Add a connection to the external system", everything else is exactly the same. To add a connection to the sample WCF service provided in the SDK, perform the following steps.

  2. Click Click here to discover external data sources and define operations next to the Connected System.

  3. In the Add Connection dialog box, click WCF Service. Then, in the WCF Service Connection dialog box, do the following steps.

  4. In the Service Metadata URL, you can enter one of the following: the URL to the endpoint exposed using MetadataExchange contract, the WSDL location of a WCF service, or a URL to a network location where the WSDL and XSD schema files have been downloaded and stored. In this example, enter the URL to the WSDL.

  5. In the Connection Mode field, you can select WSDL or Metadata Exchange depending on how the endpoint is exposed. In this example, select WSDL.

  6. In the Service Endpoint URL field, enter the service endpoint URL and click OK to accept the other default settings.

  7. Now follow the steps described in How to: Create an External Content Type Based on a Web Service to define the operations and to create the external content type.