我正在尝试使用 ARM 模板在 Azure APIM 中自动执行 SOAP 直通 API 部署。 以下是我遵循的步骤:
- 通过导入 WSDL 文件在 Azure 门户上创建了 API。
- 使用"自动化脚本"从 APIM 实例生成和下载 API 的 ARM 配置。
- 为以下资源提取此 ARM 模板并将其参数化:
- Microsoft.ApiManagement/service/apis
- Microsoft.ApiManagement/service/apis/operations
- Microsoft.ApiManagement/service/apis/schemas
- Microsoft.ApiManagement/service/products/apis
- 使用 Visual Studio (2017) 在 Azure 上部署 ARM 模板。
API及其相关操作等部署成功。但是,我观察到以下两件事:
- Azure APIM 未将此 API 标记为 SOAP。
- API 端点不起作用:我在尝试访问它时不断收到 404。
这是 API 的 ARM 模板:
{
"comments": "= = = API = = =",
"type": "Microsoft.ApiManagement/service/apis",
"name": "[concat(variables('apimInstanceName'), '/', parameters('apiName'))]",
"apiVersion": "2017-03-01",
"scale": null,
"properties": {
"displayName": "[parameters('apiName')]",
"apiRevision": "1",
"description": "SOAP service",
"serviceUrl": "[parameters('serviceUrl')]",
"path": "[parameters('apiName')]",
"protocols": [
"http",
"https"
],
"authenticationSettings": null,
"subscriptionKeyParameterNames": null,
"type": "soap",
"isCurrent": true,
"apiType": "soap"
},
"dependsOn": [
]
}
我没有发布其他组件的 ARM 模板只是为了检查这篇文章的长度。
我是否在 API 模板中缺少任何内容以使其按预期工作?
这可能不再相关,但我遇到了类似的问题。在预配 SOAP 终结点时,我使用以下模板来配置 SOAP 直通 API。
最初,它被配置为 SOAP 到 REST,并在 URL 的末尾附加操作名称。然后我"apiType": "soap"
包含在模板中,它按预期工作。
在我的模板中,我使用最新的 API 版本"apiVersion": "2020-12-01"
并通过将其作为字符串传递来导入 WSDL 文档。在理想情况下,可以使用"format": "wsdl-link"
从位于 API 管理本身后面的 API 导入架构。
{
"type": "Microsoft.ApiManagement/service/apis",
"apiVersion": "2020-12-01",
"name": "[variables('soapApiName')]",
"properties": {
"displayName": "Inventory SOAP API",
"path": "InventoryService.svc",
"protocols": [
"https"
],
"type": "soap",
"apiType": "soap",
"subscriptionRequired": false,
"format": "wsdl",
"value": "[parameters('wsdlDocument')]"
}
}