代码示例:AdventureWorks2008 WCF 服务

上次修改时间: 2010年7月16日

适用范围: SharePoint Server 2010

AdventureWorks2008 WCF 服务示例演示如何将 Windows Communication Foundation (WCF) 服务用作外部系统。

Web 服务公开针对 SalesCustomer、SalesOrderHeader 和 SalesOrderHeaderDetails 实体的 CreateReadUpdateDelete (CRUD) 操作的方法,以及基于这些实体之间的关系返回数据的其他操作。

若要为此示例创建 Business Data Connectivity (BDC) Service 模型文件,请参阅如何:基于 WCF 端点创建外部内容类型

先决条件:

  • Internet Information Services (IIS)

  • Microsoft .NET Framework 3.5 Service Pack 1

  • Microsoft SharePoint Server 2010

  • Microsoft SQL Server 2008 和 Microsoft SQL Management Studio

下载和使用示例

  1. SharePoint 2010 参考:软件开发工具包(该链接可能指向英文页面)下载 Microsoft SharePoint 2010 软件开发工具包 (SDK)。

  2. 从 %ProgramFiles%\Microsoft SDKs\SharePoint 2010\Samples\Business Connectivity Services 路径将 bcs sample kit.zip 解压缩到本地文件夹。

  3. 在解压缩文件的文件夹中,找到 AdventureWorks2008 WCF Service 文件夹并打开 Readme.htm 文件。

  4. 按照 Readme.htm 中的说明使用示例。