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
5. Publish both microflows as web service operation of the **CustomerWebservice** as described in chapter 4 of the how-to [Exposing a web service](/howto8/integration/expose-a-web-service/).
53
53
@@ -57,39 +57,39 @@ In this chapter you will create a new SOAP project.
@@ -144,15 +144,15 @@ In this chapter you will build a testsuite. A testsuite contains one or more tes
144
144
Assertions are used to validate the message received by a TestStep during execution, usually by comparing parts of the message (or the entire message) to some expected value. Inthis chapter you will create an assertion that validates the number of customers.
5.Enter*count(//Customer)* in the XPath Expression field.
154
154
6.In step 1.4 of the previous how-to you have added some data. Enter the number of created customers in the **ExpectedResult** field. Inthis example four customers were created.
Copy file name to clipboardExpand all lines: content/en/docs/refguide9/modeling/integration/rest-services/consumed-rest-services/consume-a-rest-service.md
description: "Describes how to get information from a REST service."
9
+
aliases:
10
+
- /howto9/integration/consume-a-rest-service/
9
11
---
10
12
11
13
## 1 Introduction
12
14
13
-
In your Mendix app, you can use information from REST services. This how-to shows you how to do that through an example in which you create an app that retrieves Wikipedia pages from a REST service. The resulting app is [available for download](/attachments/howto9/integration/consume-a-rest-service/WikipediaApi.mpk).
15
+
In your Mendix app, you can use information from REST services. This how-to shows you how to do that through an example in which you create an app that retrieves Wikipedia pages from a REST service. The resulting app is [available for download](/attachments/refguide9/integration/consume-a-rest-service/WikipediaApi.mpk).
14
16
15
17
This how-to will teach you how to do the following:
16
18
@@ -25,14 +27,14 @@ We will start by providing Studio Pro as an example of what the REST service ret
25
27
1. Open your browser and go to [https://en.wikipedia.org/api/rest_v1/page/summary/Tahiti](https://en.wikipedia.org/api/rest_v1/page/summary/Tahiti).
26
28
2. This calls the REST service with a GET request – the result is the summary of the [Tahiti page on Wikipedia](https://en.wikipedia.org/wiki/Tahiti) in the JSON format:
27
29
28
-
{{< figure src="/attachments/howto9/integration/consume-a-rest-service/get-call-result.png" alt="Screenshot of the result of the rest call" >}}
30
+
{{< figure src="/attachments/refguide9/integration/consume-a-rest-service/get-call-result.png" alt="Screenshot of the result of the rest call" >}}
29
31
30
32
3. Select the **Raw Data** tab and copy the whole whole JSON snippet.
31
33
4. Create a module and name it *RESTconsume*. Add the new [JSON structure](/refguide9/json-structures/) to your module: right-click the module in the **App Explorer** and select **Add other** > **JSON structure**.
32
34
5. Enter a **Name** for the structure: *JSON_structure* and click **OK**.
33
35
6. In the **JSON Structure** dialog box, paste the JSON snippet in the **General** tab and click **Refresh** in the **Structure** section. This analyzes the structure of the JSON snippet and provides a representation of it.
8. Double-click **Import_mapping** in the **App Explorer** and from the **Connector** pane, drag **Input** as the input parameter for the input mapping.
75
77
9. Double-click **Summary**.
76
78
10. In the **Map entity 'Summary' from schema object element 'Root** dialog box, **Set association** to **Yes** and select the **RESTconsume_input_Summary** for the **Association** to enable the import mapping to set the association:
77
79
78
-
{{< figure src="/attachments/howto9/integration/consume-a-rest-service/map-entity-from-input-mapping.png" alt="map entity from input mapping" >}}
80
+
{{< figure src="/attachments/refguide9/integration/consume-a-rest-service/map-entity-from-input-mapping.png" alt="map entity from input mapping" >}}
79
81
80
82
11. Click **OK**.
81
83
@@ -91,13 +93,13 @@ To call the REST service in a microflow, follow these steps:
91
93
4. Right-click and select **Add** > **Activity** and insert this to the microflow. Double-click the activity and select **Call REST service** to change the type of action.
92
94
5. In the **Call REST** dialog box, click **Edit** for the **Location** and add the following to **Template**: `https://en.wikipedia.org/api/rest_v1/page/summary/{1}`, with the parameter being the Title attribute from the **Input** parameter `$Input/Title`. Click **OK**.
You have successfully consumed a REST service and created a microflow to show the results. The rest of this how-to describes how to use this microflow in an app so that you can see the REST call in action.
121
123
@@ -141,7 +143,7 @@ To create a page for this app, follow these steps:
141
143
16. For **Show label**, select **No**, then click **OK**.
0 commit comments