【问题标题】:Using ARM template to deploy SOAP pass-through on Azure APIM使用 ARM 模板在 Azure APIM 上部署 SOAP 直通
【发布时间】:2018-01-15 22:28:37
【问题描述】:

我正在尝试使用 ARM 模板在 Azure APIM 中自动执行 SOAP 传递 API 部署。 以下是我遵循的步骤:

  1. 通过导入 WSDL 文件在 Azure 门户上创建 API。
  2. 使用“自动化脚本”从 APIM 实例生成和下载 API 的 ARM 配置。
  3. 为以下资源提取了此 ARM 模板并对其进行了参数化:
    • Microsoft.ApiManagement/service/apis
    • Microsoft.ApiManagement/service/apis/operations
    • Microsoft.ApiManagement/service/apis/schemas
    • Microsoft.ApiManagement/service/products/apis
  4. 使用 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 模板中的任何内容以使其按预期工作?

【问题讨论】:

  • 经过进一步调查,我发现 APIM 公开的 SOAP 端点不是 / 而是 //?SOAPAction=tempuri.org/<SOAPServiceOperationName>
  • 如果解决了,您可以将其添加为答案,以帮助更多有相同问题的社区轻松搜索。
  • 嗨@TomSun,它仍然没有解决,因为如果我的 API 有多个操作,上面提到的 URL 将不起作用。因此,我没有将其标记为答案。

标签: azure soap azure-api-management


【解决方案1】:

这可能不再相关,但我遇到了类似的问题。在配置 SOAP 端点时,我使用以下模板来配置 SOAP 传递 API。

最初,它作为 SOAP 提供给 REST,并将操作名称附加到 URL 的末尾。然后我将"apiType": "soap" 包含到模板中,它按预期工作。

在我的模板中,我使用最新的 API 版本 "apiVersion": "2020-12-01",并通过将 WSDL 文档作为字符串传递来导入它。在理想情况下,您可以使用 "format": "wsdl-link" 从位于 API Management 本身后面的 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')]"
    }
}

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2019-02-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-09-28
    • 1970-01-01
    • 2017-12-19
    相关资源
    最近更新 更多