You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/api-management/mock-api-responses.md
+34-20Lines changed: 34 additions & 20 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,11 +1,11 @@
1
1
---
2
-
title: Tutorial - Mock API responses in API Management - Azure portal | Microsoft Docs
3
-
description: Use Azure API Management to set a policy on an API. The policy returns a mock response even if the backend isn't available to send real responses.
2
+
title: "Tutorial: Mock API Responses in API Management"
3
+
description: Use Azure API Management to set a policy on an API to return a mock response even if the backend isn't available to send real responses.
Backend APIs are imported into an Azure API Management API or created and managed manually. The steps in this tutorial describe how to:
24
+
Backend APIs can be imported into an Azure API Management API or created and managed manually. The steps in this tutorial describe how to:
25
25
26
26
+ Use API Management to create a blank HTTP API.
27
27
+ Manually manage an HTTP API.
28
28
+ Set a policy on an API so that it returns a mock response.
29
29
30
-
This method enables developers to continue with the implementation and testing of the API Management instance even if the backend isn't available to send real responses.
30
+
This method allows developers to continue with the implementation and testing of the API Management instance even if the backend isn't available to send real responses.
1. Sign in to the [Azure portal](https://portal.azure.com/), and then navigate to your API Management instance.
60
+
61
+
1. In the sidebar menu, select **APIs** > **APIs**, and then select **+ Add API**. Choose the **HTTP** tile:
61
62
62
63
:::image type="content" source="media/mock-api-responses/http-api.png" alt-text="Screenshot that shows the first steps for defining an API." lightbox="media/mock-api-responses/http-api.png":::
63
64
64
65
1. In the **Create an HTTP API** window, select **Full**.
65
-
1. In **Display name**, enter *Test API*.
66
+
67
+
1. In **Display name**, enter *Test API*. The **Name** field fills automatically.
68
+
66
69
1. In **Products**, select *Unlimited*, if that value is available. This value is available only in some tiers. You can leave the value blank for this tutorial, but you need to associate the API with a product to publish it. For more information, see [Import and publish your first API](import-and-publish.md#import-and-publish-a-backend-api).
70
+
67
71
1. In **Gateways**, select **Managed** if this option is available. (This option is available only in certain service tiers.)
72
+
68
73
1. Select **Create**.
69
74
70
75
:::image type="content" source="media/mock-api-responses/create-http-api.png" alt-text="Screenshot that shows the Create an HTTP API window." lightbox="media/mock-api-responses/create-http-api.png":::
@@ -76,26 +81,33 @@ An API exposes one or more operations. In this section, you add an operation to
76
81
### [Portal](#tab/azure-portal)
77
82
78
83
1. Select the API that you created in the previous step.
84
+
79
85
1. Select **+ Add Operation**.
86
+
80
87
1. In the **Frontend** window, enter the following values:
|**Display name**|*Test call*| The name displayed in the [developer portal](api-management-howto-developer-portal.md). |
92
+
|**Name**|*test-call*| This field fills automatically. |
85
93
|**URL** (first box) | GET | Select one of the predefined HTTP verbs. |
86
94
|**URL** (second box)|*/test*| A URL path for the API. |
87
-
|**Description**|| An optional description of the operation. It provides documentation in the developer portal to the developers who use the API. |
95
+
|**Description**|| An optional description of the operation. It provides documentation in the developer portal to the developers who use the API. |
88
96
89
97
:::image type="content" source="media/mock-api-responses/frontend-window.png" alt-text="Screenshot that shows the Frontend window." lightbox="media/mock-api-responses/frontend-window.png":::
90
98
91
-
1. Select the **Responses** tab, which is located under the **URL**, **Display name**, and **Description** boxes. You'll enter values on this tab to define response status codes, content types, examples, and schemas.
99
+
1. Select the **Responses** tab, which is located under the **URL**, **Display name**, and **Description** boxes. Enter values on this tab to define response status codes, content types, examples, and schemas.
100
+
92
101
1. Select **+ Add response**, and then select **200 OK** from the list.
93
102
94
103
:::image type="content" source="media/mock-api-responses/add-response.png" alt-text="Screenshot that shows the Responses tab." lightbox="media/mock-api-responses/add-response.png":::
95
104
96
105
1. In the **Representations** section, select **+ Add representation**.
106
+
97
107
1. Enter *application/json* into the search box and then select the **application/json** content type.
108
+
98
109
1. In the **Sample** box, enter `{ "sampleField" : "test" }`.
110
+
99
111
1. Select **Save**.
100
112
101
113
:::image type="content" source="media/mock-api-responses/add-representation.png" alt-text="Screenshot that shows the Representations section." lightbox="media/mock-api-responses/add-representation.png":::
@@ -105,7 +117,7 @@ Although it's not required for this example, you can configure more settings for
105
117
|Tab |Description |
106
118
|---------|---------|
107
119
|**Query**| Add query parameters. Besides providing a name and description, you can also provide values that are assigned to a query parameter. You can mark one of the values as default (optional). |
108
-
|**Request**| Define request content types, examples, and schemas. |
120
+
|**Request**| Define request content types, examples, and schemas. |
109
121
110
122
### [Azure CLI](#tab/azure-cli)
111
123
@@ -141,8 +153,11 @@ az apim api operation delete --resource-group <resource-group-name> \
141
153
## Enable response mocking
142
154
143
155
1. Select the API you created in [Create a test API](#create-a-test-api).
156
+
144
157
1. Ensure that the **Design** tab is selected.
145
-
1. Select the test operation that you added.
158
+
159
+
1. Select the **Test call** operation that you added.
160
+
146
161
1. In the **Inbound processing** section, select **+ Add policy**.
147
162
148
163
:::image type="content" source="media/mock-api-responses/add-policy.png" alt-text="Screenshot that shows the first steps for enabling response mocking." lightbox="media/mock-api-responses/add-policy.png" :::
@@ -158,11 +173,12 @@ az apim api operation delete --resource-group <resource-group-name> \
158
173
1. Select **Save**.
159
174
160
175
> [!TIP]
161
-
> A yellow bar displaying the text **Mocking is enabled** appears. This message indicates that the responses returned from API Management are mocked by the [mocking policy](mock-response-policy.md) and aren't produced by the backend.
176
+
> A yellow bar displaying the text **Mocking is enabled** appears. This message indicates that the responses returned from API Management are issued by the [mocking policy](mock-response-policy.md) and aren't produced by the backend.
162
177
163
178
## Test the mocked API
164
179
165
180
1. Select the API you created in [Create a test API](#create-a-test-api).
181
+
166
182
1. On the **Test** tab, ensure that the **Test call** API is selected, and then select **Send** to make a test call:
167
183
168
184
:::image type="content" source="media/mock-api-responses/test-mock-api.png" alt-text="Screenshot that shows the steps for testing the mocked API." lightbox="media/mock-api-responses/test-mock-api.png":::
@@ -173,7 +189,5 @@ az apim api operation delete --resource-group <resource-group-name> \
173
189
174
190
## Next step
175
191
176
-
Go to the next tutorial:
177
-
178
192
> [!div class="nextstepaction"]
179
193
> [Transform and protect a published API](transform-api.md)
Copy file name to clipboardExpand all lines: articles/api-management/restify-soap-api.md
+17-12Lines changed: 17 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,18 +1,18 @@
1
1
---
2
-
title: Import a SOAP API to Azure API Management and convert it to REST using the portal | Microsoft Docs
3
-
description: Learn how to import a SOAP API into Azure API Management as a WSDL specification and convert it to a REST API. Then test the API in the Azure portal.
2
+
title: Import a SOAP API into API Management and Convert it to REST
3
+
description: Learn how to import a SOAP API into Azure API Management as a WSDL specification and convert it to a REST API.
4
4
services: api-management
5
5
author: dlepow
6
6
ms.custom: devdivchpfy22
7
7
ms.service: azure-api-management
8
8
ms.topic: how-to
9
-
ms.date: 03/27/2025
9
+
ms.date: 03/13/2026
10
10
ms.author: danlep
11
11
12
12
#customer intent: As a developer, I want to import a SOAP API into API Management and convert it to REST.
13
13
14
14
---
15
-
# Import a SOAP API to API Management and convert it to REST
15
+
# Import a SOAP API into Azure API Management and convert it to REST
## <aname="create-api"> </a>Import and publish a backend API
36
36
37
-
1. In the left pane, in the **APIs** section, select **APIs**.
37
+
1. In the sidebar menu, in the **APIs** section, select **APIs**.
38
+
38
39
1. On the APIs page, select **+ Add API**.
39
-
1. Under **Create from definition**, select **WSDL**:
40
+
41
+
1. Under **Create from definition**, select the **WSDL** tile:
40
42
41
43
:::image type="content" source="./media/restify-soap-api/wsdl-api.png" alt-text="Screenshot that shows the WSDL tile in the Azure portal.":::
42
44
43
-
1. In **WSDL specification**, enter the URL to your SOAP API, or click **Select a file** to select a local WSDL file.
44
-
1. Under **Import method**, select **SOAP to REST**.
45
+
1. In **WSDL specification**, enter the URL to your SOAP API, or choose **Select a file** to select a local WSDL file.
46
+
47
+
1. Under **Import method**, select **SOAP to REST**.
48
+
45
49
When this option is selected, API Management attempts to make an automatic transformation between XML and JSON. In this case, consumers should call the API as a RESTful API, which returns JSON. API Management converts each request to a SOAP call.
46
50
47
51
:::image type="content" source="./media/restify-soap-api/soap-to-rest.png" alt-text="Screenshot that shows the SOAP to REST option." lightbox="./media/restify-soap-api/soap-to-rest.png":::
48
52
49
53
1. The **Display name** and **Name** boxes are filled automatically with information from the SOAP API.
50
-
51
-
**Display name**, **URL**, and **Description** information is automatically entered for operations. Operations also receive a system-generated **Name**.
54
+
52
55
1. Enter other API settings, and then select **Create**. You can also configure these values later by going to the **Settings** tab.
53
56
54
-
For more information about API settings, see [Import and publish your first API](import-and-publish.md#import-and-publish-a-backend-api).
57
+
For more information about API settings, see [Import and publish a backend API](import-and-publish.md#import-and-publish-a-backend-api).
55
58
56
59
## Test the new API in the Azure portal
57
60
58
61
You can call operations directly from the Azure portal. This method provides a convenient way to view and test the operations of an API.
59
62
60
63
1. Select the API you created in the previous step.
64
+
61
65
1. Select the **Test** tab.
66
+
62
67
1. Select an operation.
63
68
64
69
The page shows fields for query parameters and fields for the headers. One of the headers is **Ocp-Apim-Subscription-Key**. This header is for the subscription key of the product that's associated with this API. If you created the API Management instance, you're an admin already, so the key is filled in automatically.
0 commit comments