Changes for page Endpoint Check
Last modified by Danniar Firdausy on 2024/09/04 10:26
From version 36.2
edited by Erik Bakker
on 2022/06/12 09:36
on 2022/06/12 09:36
Change comment:
Update document after refactoring.
To version 47.1
edited by Erik Bakker
on 2022/12/30 12:37
on 2022/12/30 12:37
Change comment:
There is no comment for this version
Summary
-
Page properties (4 modified, 0 added, 0 removed)
Details
- Page properties
-
- Title
-
... ... @@ -1,1 +1,1 @@ 1 -n ovice-soap-webservice-connectivity-soap-headers1 +Endpoint Check - Parent
-
... ... @@ -1,1 +1,1 @@ 1 -WebHome 1 +Main.eMagiz Academy.Microlearnings.Novice.SOAP Web service Connectivity.WebHome - Default language
-
... ... @@ -1,0 +1,1 @@ 1 +en - Content
-
... ... @@ -1,113 +1,71 @@ 1 1 {{container}}{{container layoutStyle="columns"}}((( 2 -When setting up a point at which your customers can talk to you eMagiz offers various methods of creating such a point. One of those options is by hosting a SOAP Webservice in eMagiz that handles XML messages asynchronously or synchronously. Inthismicrolearning,wewill zoomin on the part that validationof the messagesplayswhenofferingsuch aSOAPwebservice.2 +When setting up a point at which your customers can talk to you eMagiz offers various methods of creating such a point. One of those options is by hosting a SOAP Webservice in eMagiz that handles XML messages asynchronously or synchronously. One last check to perform before you can communicate with the external parties that the endpoint is available to receive messages and up and running. In this microlearning, we will learn how you can perform such a check. 3 3 4 4 Should you have any questions, please contact academy@emagiz.com. 5 5 6 -* Last update: June 10th, 2021 7 -* Required reading time: 7 minutes 8 - 9 9 == 1. Prerequisites == 10 10 * Basic knowledge of the eMagiz platform 11 11 12 12 == 2. Key concepts == 13 -This microlearning centers around configuring your SOAP webservice.10 +This microlearning centers around the endpoint check. 14 14 15 -By configuring, we mean:Designingand determiningthe characteristicsof the SOAPwebservice12 +By endpoint check, we mean: determine whether the WSDL is accessible on the correct endpoint so we can forward the URL to the WSDL + the URL to call to our external parties 16 16 17 -Crucial parts in the configuration are: 18 -* Operation Name 19 -* SOAP Webservice Namespace 20 -* Validation 21 -* Authentication 14 +* The endpoint consists of the following elements: 15 + ** Starts with https:// or http:// 16 + ** Second part is the host (i.e. where is the endpoint running) 17 + ** Third part is the port on which the incoming traffic is accepted 18 + ** These three things combined make up the first part of our endpoint that will vary per environment 19 + ** Following that we have a static remainder of the endpoint that is build up as follows: /{soap WS name}/{Id}/ 20 + ** If you want to get to the WSDL simply add the name of the WSDL (which is defined by the Id given to the "Dynamic WSDL" support object) and the .wsdl extension to the endpoint when viewing it in the browser 22 22 23 -Of these four points, we will zoom in on the validation part of our SOAP Webservice in this microlearning. 24 - 25 -== 3. Validate Incoming Messages == 22 +== 3. Endpoint Check == 26 26 27 -When setting up a point at which your customers can talk to you eMagiz offers various methods of creating such a point. One of those options is by hosting a SOAP Webservice in eMagiz that handles XML messages asynchronously or synchronously. Inthismicrolearning,wewill zoomin on the part that validationof the messagesplayswhenofferingsuch aSOAPwebservice.24 +When setting up a point at which your customers can talk to you eMagiz offers various methods of creating such a point. One of those options is by hosting a SOAP Webservice in eMagiz that handles XML messages asynchronously or synchronously. One last check to perform before you can communicate with the external parties that the endpoint is available to receive messages and up and running. In this microlearning, we will learn how you can perform such a check. 28 28 29 -Crucial parts in the configuration are: 30 -* Operation Name 31 -* SOAP Webservice Namespace 32 -* Validation 33 -* Authentication 26 +* The endpoint consists of the following elements: 27 + ** Starts with https:// or http:// 28 + ** Second part is the host (i.e. where is the endpoint running) 29 + ** Third part is the port on which the incoming traffic is accepted 30 + ** These three things combined make up the first part of our endpoint that will vary per environment 31 + ** Following that we have a static remainder of the endpoint that is build up as follows: /{soap WS name}/{Id}/ 32 + ** If you want to get to the WSDL simply add the name of the WSDL (which is defined by the Id given to the "Dynamic WSDL" support object) and the .wsdl extension to the endpoint when viewing it in the browser 34 34 35 - Of thesefourpoints,wewill zoominonthe validation partof our SOAP Webservicein this microlearning.TheSOAP Webservice serves as a pointof entry wherepeople with therightscredentials(security)andthe rightanswers(validation) areallowedtoenterandperform theiractions. Inthenextmicrolearning,wewilltalkabout thesecuritypart.In this microlearning,we talk aboutthevalidationpart.34 +As you can see the endpoint can be divided into two parts. One part is dynamic across environments and one part is static across environments. Let us first determine how we can find out the first part of our endpoint. 36 36 37 - Asyou have learned from the crash course you can validate an XML message with the help of an XSD. This XSD describes dataTypes, order, associations, and length of attributes. You can use such an XSDforthe validation of what your clients send you. eMagiz will automatically define a WSDL based on the XSD that you provide that stores metainformation and stores the XSD for validation purposes.Thisway you can communicate the WSDL (location) to external parties as a reference document upon which they can build their solution. If you keep the eMagiz defaults you can access the WSDL via http://host:port/ws/ws-name/ws-name.wsdl. Note that you need to all values (except for the ws and .wsdl part) with actual values.36 +=== 3.1 HTTPS or HTTP === 38 38 39 -W hateMagizdoesneed fromyouisthecorrectXSD forvalidation. AsastartingpointyoushoulddownloadtheXSDthateMagizhas generatedbased on thesystem message(s)you havedefinedheDesignphase.Onceyouhave thatyou can structure theXSD correctly.A valid XSDstart witha schema segment.InthisegmentyouneedtodefineyourSOAPWSnamespace:38 +We start at the top with the determination of HTTPS or HTTP. A simple rule of thumb is that when running in the eMagiz Cloud the endpoint starts with https:// and when the endpoint is running locally (i.e. on-premise) the endpoint starts with http:// (unless you secure it yourself, more on that later). 40 40 41 -<?xml version="1.0" encoding="UTF-8" standalone="yes"?> 42 -<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" 43 - xmlns="http://www.academy.emagiz.com/ns/mlacade-bus/spwbsrv-connector/1.0/" 44 - attributeFormDefault="unqualified" elementFormDefault="unqualified" 45 - targetNamespace="http://www.academy.emagiz.com/ns/mlacade-bus/spwbsrv-connector/1.0/"> 40 +=== 3.2 Host === 46 46 47 - Onceyouhave thatyou need to copyallcomplexand simple types fromtheXSDthatyou downloaded andpaste thembelowthelinesyou havecreated:42 +The next part of the endpoint is the host. The host is effectively the (virtual) machine on which the endpoint is running. When hosting an endpoint in the eMagiz cloud the host part is the combination between the DNS left-most label on Route level and the cloudslot on which your environment is running. The first part of the equation can be found under Deploy -> Architecture. The second part can be found under Deploy -> Properties by looking for the {technicalnameproject}.amqp01.host. You need to combine the two elements via a dash -. An example of this would then be spwbsrv-test-cloud0001.emagizcloud.com. In case of an on-premise installation, you should ask your customer what the IP address or DNS name is to connect to the machine on which your runtime is running. If the runtime is running locally on your laptop the host equals localhost. 48 48 49 -<xs:complexType name="Input"> 50 - <xs:sequence> 51 - <xs:element name="String" type="nonEmptyString"/> 52 - <xs:element minOccurs="0" name="Decimal" type="xs:decimal"/> 53 - <xs:element name="Enum" type="Enum"/> 54 - <xs:element name="Integer" type="xs:long"/> 55 - <xs:element name="Boolean" type="xs:boolean"/> 56 - <xs:element minOccurs="0" name="DateTime" type="xs:dateTime"/> 57 - </xs:sequence> 58 - </xs:complexType> 59 - <xs:simpleType name="nonEmptyString"> 60 - <xs:restriction base="xs:string"> 61 - <xs:minLength value="1"/> 62 - </xs:restriction> 63 - </xs:simpleType> 64 - <xs:simpleType name="Enum"> 65 - <xs:restriction base="xs:string"> 66 - <xs:enumeration value="URGENT"/> 67 - <xs:enumeration value="HIGH"/> 68 - <xs:enumeration value="MEDIUM"/> 69 - <xs:enumeration value="LOW"/> 70 - <xs:enumeration value="PLANNING"/> 71 - </xs:restriction> 72 - </xs:simpleType> 44 +=== 3.3 Port and Path === 73 73 74 - Towrapthingsupyouneed to define yourRequest andResponse element andclose the schema:46 +Whether or not the port needs to be defined to get to the endpoint is once again determined by the location. If the endpoint is hosted in the eMagiz Cloud the port is *not* part of the endpoint. However, when you host your endpoint locally the endpoint becomes part of your endpoint. Note that to make this piece work in the eMagiz Cloud you should set up your Route properly. More on that in our Cloud Management courses. You can determine the port, for the endpoint or the route, by navigating to the infra flow of the runtime through which you host your SOAP web service. In the infra flow you can also find the remainder of the path to get to the WSDL location. 75 75 76 -<xs:element name="SendNptRequest"> 77 - <xs:complexType> 78 - <xs:sequence> 79 - <xs:element name="Input" type="Input"/> 80 - </xs:sequence> 81 - </xs:complexType> 82 - </xs:element> 83 - <xs:element name="SendNptResponse"> 84 - <xs:complexType/> 85 - </xs:element> 86 - </xs:schema> 48 +In the infra flow there is a support object of the type "Dynamic WSDL". In here you see the default location of the hosted SOAP endpoint, which is http://localhost:${entry.connector.ws.port}/ws/{soap WS name}/. Based on this, you can find the WSDL by adding {Id}.wsdl to the URI. In this example, when hosting the SOAP web service on-premise, a valid URI would be "http://localhost:8099/ws/soapgn3-connector/soapgn3-connector.wsdl". 87 87 88 - Combiningthiswillresult ina valid XSD for my example. In yourcase,you will needto enterothervalues.When youaredonewiththecreationoftheXSDsaveit withaamesuchasspwbsrv-connector.xsdanduploaditotheflow.Afteryouhave uploadedtheXSDlinkittohe-xsd support objectin yourentry.50 +{{info}}Note that when running your web service in the eMagiz cloud, the first part (the host part) will change depending on your configuration in Deploy Architecture and the cloud slot on which you are running. An example URI, in that case, would be "https://soap-test-cloud0000.emagizcloud.com/ws/soapgn3-connector/soapgn3-connector.wsdl"{{/info}} 89 89 90 -[[image:Main.Images.Microlearning.WebHome@novice-soap-webservice-connectivity-validate-incoming-messages--up loaded-file.png]]52 +[[image:Main.Images.Microlearning.WebHome@novice-soap-webservice-connectivity-validate-incoming-messages-gen3--dynamic-wsdl-support-object-infra.png]] 91 91 92 -[[image:Main.Images.Microlearning.WebHome@novice-soap-webservice-connectivity-validate-incoming-messages--file-linked-to-xsd-component.png]] 93 - 94 -With this done you have successfully added validation to your SOAP web service. 95 - 96 96 == 4. Assignment == 97 97 98 - Add validation to the SOAP Webservicewe havebeenconfiguring.56 +Determine the endpoint of your SOAP Webservice and retrieve the WSDL. 99 99 This assignment can be completed with the help of the (Academy) project that you have created/used in the previous assignment. 100 100 101 101 == 5. Key takeaways == 102 102 103 -* Crucialpartsinheconfigurationare:104 - ** OperationName105 - ** S OAPWebserviceNamespace106 - ** Validation107 - ** Authentication108 -* Validationis donewiththehelpof anXSD109 -* The WSDLisusedfor externaldocumentation110 -* Use theXSD generatedbyeMagiz based onthesystemmessageasastarting point61 +* The endpoint consists of the following elements: 62 + ** Starts with https:// or http:// 63 + ** Second part is the host (i.e. where is the endpoint running) 64 + ** Third part is the port on which the incoming traffic is accepted 65 + ** These three things combined make up the first part of our endpoint that will vary per environment 66 + ** Following that we have a static remainder of the endpoint that is build up as follows: /{soap WS name}/{Id}/ 67 + ** If you want to get to the WSDL simply add the name of the WSDL (which is defined by the Id given to the "Dynamic WSDL" support object) and the .wsdl extension to the endpoint when viewing it in the browser 68 +* The relevant information can be derived from the "Dynamic WSDL" support object and by determining where the endpoint is hosted 111 111 112 112 == 6. Suggested Additional Readings == 113 113 ... ... @@ -115,6 +115,6 @@ 115 115 116 116 == 7. Silent demonstration video == 117 117 118 -{{video attachment="novice-soap-webservice-connectivity- validate-incoming-messages.mp4" reference="Main.Videos.Microlearning.WebHome"/}}76 +{{video attachment="novice-soap-webservice-connectivity-endpoint-check-gen3.mp4" reference="Main.Videos.Microlearning.WebHome"/}} 119 119 120 120 )))((({{toc/}}))){{/container}}{{/container}}