2
votes

I am trying to automate a SOAP pass-through API deployment in Azure APIM using ARM template. Here are the steps I followed:

  1. Created the API on azure portal by importing the WSDL file.
  2. Used the "Automation scripts" to generate and download the ARM configuration for the API from the APIM instance.
  3. Extracted this ARM template for the following resources and parameterized it:
    • Microsoft.ApiManagement/service/apis
    • Microsoft.ApiManagement/service/apis/operations
    • Microsoft.ApiManagement/service/apis/schemas
    • Microsoft.ApiManagement/service/products/apis
  4. Used Visual Studio (2017) to deploy the ARM template on Azure.

The API and its related operations etc. are deployed successfully. However, I observed the following two things:

  • Azure APIM did not mark this API as SOAP.
  • The API endpoint does not work: i keep getting a 404 when trying to access it.

This is the ARM template for the API:

{
	"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": [
	]
}

I have not posted the ARM template for other components just to keep a check on the length of this post.

Am I missing anything in the API template to make it work as desired?

1
On further investigation, i found out that the APIM is exposing the SOAP endpoint not as <apimInstance>/<apiName> but rather as <apimInstance>/<apiName>/?SOAPAction=tempuri.org/<SOAPServiceOperationName>Prasoon Madnawat
If it is resolved, you could add it as an answer that could help more communites who have the same issue easily to search.Tom Sun - MSFT
Hi @TomSun, its still not resolved as the URL mentioned above is not going to work in case my API has multiple operations. Hence, i haven't marked it as an answer.Prasoon Madnawat

1 Answers

0
votes

This is probably not relevant anymore but I had a similar issue. When provisioning the SOAP endpoint I used the following template for configuring the SOAP pass-through API.

Initially, it was provisioned as SOAP to REST and it was appending the action name at the end of the URL. Then I included "apiType": "soap" to the template and it worked as expected.

In my template I use the latest API version "apiVersion": "2020-12-01" and I import the WSDL document by passing it as a string. In an ideal scenario, you can import the schema from the API that sits behind API Management itself by using "format": "wsdl-link".

{
    "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')]"
    }
}