关于如何使用 Postman 连接 Business Central 本地版

中国語

各位读者好。
最近,我看到一些关于如何使用 Postman 连接到 Business Central 本地版的问题。如您所知,随着SaaS版本的普及,使用 Business Central本地版的客户数量正在逐渐减少,但仍有大量的需求。
所以今天我想简单谈谈如何使用 Postman 连接到 Business Central 本地版。
PS: Postman 是一个用于构建和使用 API 的 API 平台。

首先,让我们安装 Business Central 的本地版。
您可以从下面的链接中选择下载您想要安装的版本(每月更新)。
Cumulative Update Summary for Microsoft Dynamics 365 Business Central(October, 2021)

如, 当前最新版本 (2021/10/13): W1 19.0 (Platform 19.0.29884.30666 + Application 19.0.29894.30693)

Business Central Server Administration:

凭证类型(Credential Type)使用的是默认 Windows

如果这时候尝试访问 Web Service的话,则无法访问。

因此,您需要在 Business Central Server Administration 中启用一些选项。
Enable SOAP Services
Enable API Services
Enable OData Services

选择Save.

新的设置值将在您重启实例后生效。

选择实例,然后点击 Restart.

再次测试 Odata V4 URL 和 Soap URL。 这时只需使用 windows 用户名和密码即可进行连接。

但是,如果此时在 Postman 中使用 Basic Auth 访问Web Service的话,则会提示 401 未经授权的错误。 (使用和上面相同Web Service访问密钥)

返回 Business Central Server Administration, 启用“Use NTLM Authentication”

再次重启实例.

选择 NTLM Authentication [Beta] 的认证类型, 然后输入Windows的用户名和密码。

测试视频:

如果你的解决方案中不是使用Windows认证,而是使用了 NavUserPasswordAccessControlService (Office 365) , 你将不需要启用 “Use NTLM Authentication”,但和SaaS一样,你需要使用 Web Service Access Key

User Card 页面生成 Web Service Access Key
详细: Generate a Web Service Access Key

然后你可以使用 User NameWeb Service Access Key (Basic Auth) 去访问 Odata 和 APIs.
测试视频: (很抱歉我的PC有点慢😢)

注意:
1. Business Central Server Administration 工具将在以后的版本中删除。
详细: Removal of the Business Central Server Administration tool (Warning)

2. Business Central SaaS 的 Web Service Access Keys (Basic Auth) 将在 Business Central 2022 发布第 1 波中删除。但对于本地版,Web Service Access Keys (Basic Auth) 暂时仍是一个选择。
详细: Web Service Access Keys (Basic Auth) for Business Central Online

以上

ZHU

コメント

Copied title and URL