Last modified by Erik Bakker on 2024/09/09 12:41

Show last authors
1 {{container}}
2 {{container layoutStyle="columns"}}
3 (((
4 Within eMagiz, you have the option to host a SOAP and a REST web service. When dealing with REST web services, the advised choice is the API Gateway in case the call is synchronous in nature. Not in all circumstances; however, the API Gateway completely suits your needs. For example, when the process is asynchronous in the heart, you will need to build your REST web services that eMagiz can host in these situations. The new functionality has become more intuitive to host a custom REST web service via eMagiz.
5
6 Should you have any questions, please get in touch with academy@emagiz.com.
7
8 == 1. Prerequisites ==
9
10 * Basic knowledge of the eMagiz platform
11 * Basic understanding of REST web services
12
13 == 2. Key concepts ==
14
15 * These changes make it more intuitively to host a custom REST web service
16 * The new approach is less dependent on the correct configuration of multiple components
17
18 == 3. Hosting a custom REST web service (and using parameters) ==
19
20 Within eMagiz, you have the option to host a SOAP and a REST web service. When dealing with REST web services, the advised choice is the API Gateway in case the call is synchronous in nature. Not in all circumstances; however, the API Gateway completely suits your needs. For example, when the process is asynchronous in the heart, you will need to build your REST web services that eMagiz can host in these situations. The new functionality has become more intuitive to host a custom REST web service via eMagiz.
21
22 Below we have detailed the legacy approach, the new approach, and how to migrate from the legacy approach to the new process.
23
24 === 3.1 Legacy approach ===
25
26 In the old situation, you would use a Simple Dispatcher servlet to define the correct endpoints that the REST web service would host. See below for how this looks.
27
28 [[image:Main.Images.Migrationpath.WebHome@migration-path-root-hosting-a-custom-rest-webservice--simple-dispatcher-servlet-config.png]]
29
30 Furthermore, you needed to use the HTTP parameter to XML component to map HTTP parameters to XML when dealing with parameters. See below for an illustration of this component.
31
32 [[image:Main.Images.Migrationpath.WebHome@migration-path-root-hosting-a-custom-rest-webservice--http-parameters-to-xml.png]]
33
34 This component resulted in an XML that needed to be transformed to a correct system message afterward.
35
36 === 3.2 New approach ===
37
38 You can more intuitively set up your REST web service in the new situation. For example, you choose the option HTTP Inbound Endpoint Dispatcher Servlet on the jetty server. This gives you the option to define the first part of your endpoint in the Jetty server.
39
40 [[image:Main.Images.Migrationpath.WebHome@migration-path-root-hosting-a-custom-rest-webservice--http-inbound-dispatcher.png]]
41
42 The remainder of your endpoint can now be defined on the Inbound gateway.
43
44 [[image:Main.Images.Migrationpath.WebHome@migration-path-root-hosting-a-custom-rest-webservice--define-operation.png]]
45
46 In the advanced tab of the Inbound gateway, you furthermore have the option to add all path and query parameters to separate headers (one header per path or query parameter). This means you can easily use this information further downstream in your mapping when you need it.
47
48 [[image:Main.Images.Migrationpath.WebHome@migration-path-root-hosting-a-custom-rest-webservice--map-parameters-to-headers.png]]
49
50 === 3.3 How to get to the new approach ===
51
52 Migrating from the old way of hosting a custom REST web service to the new way of hosting a custom REST web service needs several steps to make it work correctly. First, follow them carefully to achieve the desired result.
53 In this case, a detailed user guide is already available within the portal. So instead of listing the steps once more, we advise you to read that user guide. Please go to this [[microlearning>>doc:Main.eMagiz Academy.Microlearnings.Legacy Functionality.intermediate-rest-webservice-connectivity-configuration.WebHome||target="blank"]]
54
55 == 4. Key takeaways ==
56
57 * These changes make it more intuitively to host a custom REST web service
58 * The new approach is less dependent on the correct configuration of multiple components
59
60 == 5. Suggested Additional Readings ==
61
62 * [[REST Web service (Search Result)>>url:https://docs.emagiz.com/bin/view/Main/Search?text=%22rest%20webservice%22&f_type=DOCUMENT&f_space_facet=0%2FMain.&f_locale=en&f_locale=&f_locale=en&r=1||target="blank"]]
63 )))
64
65 (((
66 {{toc/}}
67 )))
68 {{/container}}
69 {{/container}}