---
schema_version: "1"
id: 43db3b3878419213cb27d8fb9027ca6abd3441f1a29f7f1b59d60c0e7fdcf4b6
title: 使用 Web Data Connector 3.0 SDK 构建的连接器
collection: tableau
version: next
locale: zh-cn
portal_url: https://docs.salesforce.com/tableau/next/zh-cn/pro/desktop/examples_wdc_connector_sdk.md
canonical_url: https://help.tableau.com/v0.0/pro/desktop/zh-cn/examples_wdc_connector_sdk.htm
source_site: help.tableau.com
content_type: documentation
content_hash: d3340e67c0f116882a684c864960b1bd6e02620f236b6892ea751dca65db1c43
description: Use and build connectors with the Web Data Connector 3.0 SDK for web data and APIs.
---
[跳转到主要内容](#main-content)

# 使用 Web Data Connector 3.0 SDK 构建的连接器

Web 数据连接器 3.0 是 Web 数据连接器的最新版本，是 Tableau 的解决方案，用于连接通过 API 而不是 ODBC/JDBC 驱动程序公开的 Web 应用程序和服务中的数据。

Web 数据连接器 3.0 SDK 提供了为 Web 数据构建自定义连接器所需的工具。此外，可以使用 Tableau Exchange 中合作伙伴构建的连接器。

**注意：**Web 数据连接器 3.0 是 2022.3 Tableau 版本的一部分。

## 关于 Web 数据连接器 3.0

与 Web 数据连接器的早期版本不同，类似于 Tableau 连接器 SDK，Web 数据连接器 3.0允许您构建 Web 数据的自定义连接器，并将连接器打包为 .taco 文件。WDC 3.0 连接器可以像使用 Tableau 连接器 SDK 构建的任何基于驱动程序的连接器一样使用，并且不需要您在自己的 Web 服务器上托管连接器。

与其他 .taco 连接器一样，WDC 3.0 连接器也是打包并签名的 .jar 文件，其中包含一组 XML 和 Javascript/TypeScript 文件。这些文件定义了连接器的外观和行为，其中包括：

- 基于 Web 的连接器 UI
- 从应用程序或服务端点检索数据的 API 调用
- 用于将检索到的数据映射到 Tableau 数据提取中的说明

### WDC 3.0 连接器限制

- 在 Tableau 的连接中使用 WDC 3.0 数据源时，_不_支持向其他数据源添加多个连接。
- Web 数据连接器 3.0 仍然只支持数据提取，但允许您可视化您的数据并发布您的分析，就像任何其他数据源一样。

## 构建您自己的连接器

若要开始构建自己的自定义连接器，请参考正式的 [Web 数据连接器 3.0 文档](https://help.tableau.com/current/api/webdataconnector/zh-cn/index.html)。

## 使用通过 Web Data Connector 3.0 SDK 构建的连接器

使用 Web 数据连接器 3.0 SDK 构建连接器后，请按照以下步骤在 Tableau 中使用它：

1. 下载连接器文件，即\[连接器名称\].taco。
2. 将 .taco 文件放在以下目录中（默认位置）：
    - 对于 2021.2 及更高版本： <table class="simple-table" style="width: 100%;"><colgroup><col style="width: 264px;"><col style="width: 33%;"><col></colgroup><tbody><tr><th>适用于 Tableau Desktop</th><th>对于 Tableau Prep Builder</th><th>对于 Tableau Server</th></tr><tr><td><ul><li>Windows - C:\用户\[Windows 用户]\文档\我的 Tableau 存储库\Connectors</li><li>macOS - /用户/[用户]/文档/我的 Tableau 存储库/Connectors</li></ul></td><td><ul><li>Windows：C:\用户\[Windows 用户]\文档\我的 Tableau Prep 存储库\Connectors</li><li>MacOS：/用户//文档/我的 Tableau Prep 存储库/Connectors</li></ul></td><td><ul><li><p>Windows：C:\Program Files\Tableau\onnectors</p></li><li><p>Linux：/opt/tableau/connectors</p></li></ul></td></tr></tbody></table>
    - 对于 2021.1 及更低版本：<table class="simple-table" style="width: 100%;"><colgroup><col style="width: 33%;"><col style="width: 33%;"><col></colgroup><tbody><tr><th>适用于 Tableau Desktop</th><th>对于 Tableau Prep Builder</th><th>对于 Tableau Server、Tableau Prep Conductor、Tableau Prep Flow Authoring</th></tr><tr><td><ul><li>Windows - C:\用户\[Windows 用户]\文档\我的 Tableau 存储库\Connectors</li><li>macOS - /用户/[用户]/文档/我的 Tableau 存储库/Connectors</li></ul></td><td><ul><li>Windows：C:\用户\[Windows 用户]\文档\我的 Tableau Prep 存储库\Connectors</li><li>MacOS：/用户//文档/我的 Tableau Prep 存储库/Connectors</li></ul></td><td><ul><li>Tableau Server：[Tableau Server 安装目录]/data/tabsvc/vizqlserver/Connectors</li></ul><p>若要为 Prep 启用连接器，您还需要将 taco 添加到以下位置：</p><ul><li>Tableau Prep Conductor：[Tableau Server 安装目录]/data/tabsvc/flowprocessor/Connectors</li><li>Tableau Prep Flow Authoring：[Tableau Server 安装目录]/data/tabsvc/flowqueryservice/Connectors</li></ul></td></tr></tbody></table>

**注意：**安装连接器后，它将显示在 Tableau 中的连接器列表中。

如果您发现 WDC 库、模拟器或任何开发人员示例有问题，请[在 Github 上提交问题](https://github.com/tableau/wdc3/issues)。

## 将 Tableau 连接到数据

1. 启动 Tableau，并在“连接”下选择刚刚安装的连接器的名称。有关数据连接器的完整列表，请在“至服务器”下选择“更多”。
2. 输入系统提示您输入的信息，然后选择“登录”。
3. 当连接器将您的数据检索到 Tableau 中时，请稍候。
4. 选择工作表标签以开始分析。

## 连接器的加载顺序

如果连接器与已注册的连接器具有相同的类别，则新连接器将被拒绝。当两个连接器具有相同的类名称时，首先加载的连接器具有优先权。

Tableau 按目录采用下列顺序加载连接器：

1. 内置 Tableau 连接器
2. 位于 `C:\Program Files\Tableau\Connectors` (Windows) 或 `/opt/tableau/connectors` (Linux) 的连接器
3. 位于 `My Tableau Repository/Connectors` 的连接器
4. （可选）`-DConnectPluginsPath` 指定的 dev 路径中的连接器

## 已知问题（仅限 Tableau Server）

尝试连接到 Tableau Server 上基于 WDC 3.0 的连接器时，用户可能会看到“Tableau Server（版本<版本号>）在使用此工作表时遇到错误”错误消息。

出现此错误的原因是，创建工作簿时所用的基于 Web Data Connector 3.0 的连接器与多节点 Tableau Server 不兼容。此问题已在维护版本中解决。有关详细信息，请参见[使用基于 WDC 3.0 的连接器进行 Web 制作时，收到 HTTP 503 以及错误“遇到错误”](https://issues.salesforce.com/issue/a028c00000yDv5zAAC/unable-to-use-the-connector-created-by-customers-as-the-taco-file-with-wdc-30-sdk-and-receiving-http-status-code-503)知识文章。

## 另请参见

- [设置数据源](https://help.tableau.com/v0.0/pro/desktop/zh-cn/datasource_prepare.htm) – 向此数据源中添加更多数据，或者在分析数据之前准备数据。
- [构建图表和分析数据](https://help.tableau.com/v0.0/pro/desktop/zh-cn/design_and_analyze.htm) – 开始数据分析。

- [Tableau 连接器 SDK](https://github.com/tableau/connector-plugin-sdk)\- 查找信息和工具以构建和测试您自己的自定义连接器。
- [使用 Tableau Exchange 中合作伙伴构建的连接器](https://help.tableau.com/v0.0/pro/desktop/zh-cn/gallery_connectors.htm) - 查找和安装 Tableau Exchange 的连接器。