Changes for page Endpoint Check
Last modified by Erik Bakker on 2024/02/21 21:35
From version 40.1
edited by Erik Bakker
on 2022/06/12 09:39
on 2022/06/12 09:39
Change comment:
There is no comment for this version
To 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.
Summary
-
Page properties (2 modified, 0 added, 0 removed)
Details
- Page properties
-
- Title
-
... ... @@ -1,1 +1,1 @@ 1 - EndpointCheck1 +novice-soap-webservice-connectivity-soap-headers - Content
-
... ... @@ -1,9 +1,9 @@ 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. Onelastchecktoperformbeforeyoucancommunicatewiththeexternalpartiesthatthe endpoint is availabletoreceivemessagesand upndrunning.In this microlearning,we will learn how you can performsuch acheck.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. In this microlearning, we will zoom in on the part that validation of the messages plays when offering such a SOAP web service. 3 3 4 4 Should you have any questions, please contact academy@emagiz.com. 5 5 6 -* Last update: June 1 1th, 20216 +* Last update: June 10th, 2021 7 7 * Required reading time: 7 minutes 8 8 9 9 == 1. Prerequisites == ... ... @@ -10,95 +10,104 @@ 10 10 * Basic knowledge of the eMagiz platform 11 11 12 12 == 2. Key concepts == 13 -This microlearning centers around the endpointcheck.13 +This microlearning centers around configuring your SOAP web service. 14 14 15 -By endpoint check, we mean:determinewhetherthe WSDLis accessible on the correctndpointowe can forwardtheURL to the WSDL+ theURL to call to ourexternal parties15 +By configuring, we mean: Designing and determining the characteristics of the SOAP web service 16 16 17 - Theendpointconsistsofthefollowing elements:18 -* Starts with https://orhttp://19 -* S econdpart is thehost (i.e. whereis the endpoint running)20 -* Thirdparts the port onwhich the incoming traffic is accepted21 -* Thesethreethingscombined make upthe first partof our endpoint that will vary per environment22 - * Following that we have a static remainder of the endpoint that is build up as follows: /ws/{path-specific-servlet-mapping}/23 - * Ifyouwantto getto the WSDL simplyaddthenameoftheWSDLandhe .wsdl extension tothe endpointwhenviewingit in thebrowser17 +Crucial parts in the configuration are: 18 +* Operation Name 19 +* SOAP Webservice Namespace 20 +* Validation 21 +* Authentication 22 + 23 +Of these four points, we will zoom in on the validation part of our SOAP Webservice in this microlearning. 24 24 25 -== 3. EndpointCheck==25 +== 3. Validate Incoming Messages == 26 26 27 -hen 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. Onelastchecktoperformbeforeyoucancommunicatewiththeexternalpartiesthatthe endpoint is availabletoreceivemessagesand upndrunning.In this microlearning,we will learn how you can performsuch acheck.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. In this microlearning, we will zoom in on the part that validation of the messages plays when offering such a SOAP web service. 28 28 29 -The endpoint consists of the following elements: 30 -* Starts with https:// or http:// 31 -* Second part is the host (i.e. where is the endpoint running) 32 -* Third part is the port on which the incoming traffic is accepted 33 -* These three things combined make up the first part of our endpoint that will vary per environment 34 -* Following that we have a static remainder of the endpoint that is build up as follows: /{context-path}/{path-specific-servlet-mapping}/ 35 -* If you want to get to the WSDL simply add the name of the WSDL and the .wsdl extension to the endpoint when viewing it in the browser 29 +Crucial parts in the configuration are: 30 +* Operation Name 31 +* SOAP Webservice Namespace 32 +* Validation 33 +* Authentication 36 36 37 - Asyoucaneetheendpointcanbedivided intotwoparts.Onepartisdynamicacrossenvironments andone part is staticacrossenvironments.Letusfirstdeterminehowwe canfindout thefirst part ofourendpoint.35 +Of these four points, we will zoom in on the validation part of our SOAP Webservice in this microlearning. The SOAP Webservice serves as a point of entry where people with the rights credentials (security) and the right answers (validation) are allowed to enter and perform their actions. In the next microlearning, we will talk about the security part. In this microlearning, we talk about the validation part. 38 38 39 - ===3.1HTTPS orHTTP===37 +As you 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 XSD for the 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. This way 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. 40 40 41 -W e start atthetopwiththedeterminationof HTTPS or HTTP. A simpleruleofthumbisthatwhenunningin the eMagizCloudthe endpointstartswithhttps://andwhentheendpointisnning locally (i.e. on-premise)theendpoint startswith http://(unless yousecureityourself,moreonthatlater).39 +What eMagiz does need from you is the correct XSD for validation. As a starting point you should download the XSD that eMagiz has generated based on the system message(s) you have defined in the Design phase. Once you have that you can structure the XSD correctly. A valid XSD start with a schema segment. In this segment you need to define your SOAP WS namespace: 42 42 43 -=== 3.2 Host === 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/"> 44 44 45 - Thenextpartofthe endpoint is the host. The host is effectivelythe (virtual) machine on whichtheendpoint is running.Whenhosting anendpoint in theeMagiz cloud the hostpart is thecombinationbetween the DNS left-most label on Routelevelandthe cloudslot on which your environment is running. The firstpart of the equation can be found under Deploy -> Architecture.The second partcan be found under Deploy-> Propertiesby lookingfor the{technicalnameproject}.amqp01.host.Youneedtocombine the two elements via a dash -. An exampleof this wouldthen be spwbsrv-test-cloud0001.emagizcloud.com.In case of anon-premise installation, youshould ask your customerwhattheIP address or DNS nameis to connect to themachineon whichyourruntime is running. If theruntime is running locally on yourlaptop thehost equals localhost.47 +Once you have that you need to copy all complex and simple types from the XSD that you downloaded and paste them below the lines you have created: 46 46 47 -=== 3.3 Port === 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> 48 48 49 - Whetherornot the port needs to be defined to get to the endpointis once again determined by the location. If the endpoint ishosted in the eMagiz Cloud theportis *not* part of the endpoint. However, whenyouhost your endpoint locally thendpointbecomes partfyour endpoint. Notethat to make this piece work intheeMagiz Cloudyoushould set up your Routeproperly. More on that in our Cloud Managementcourses. You caneterminethert, for the endpoint or the route, in twosteps.First, wenavigate to the allentrywe have created andopen the Jettycomponent. The first segmentoftheJetty Server talksabout the serverconnector. In this part, theport is defined (either viaa property or statically).74 +To wrap things up you need to define your Request and Response element and close the schema: 50 50 51 -[[image:Main.Images.Microlearning.WebHome@novice-soap-webservice-connectivity-endpoint-check--server-connector-settings.png]] 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> 52 52 53 - Ifitisdefinedvia a property you cansearch forthecorrespondingvalue underDeploy-> Propertiesbycheckingonthe propertynameandfilteringonruntimeleveltogettoport.If it isdefinedstaticallyyoucan simplyreadit here. Note thatthebest practiceis touseaproperty valueasthatallows youtouseadifferent rangefor yourportnumbering between environments.In other words,itallows youtousethe9000 rangeforTest, the8000rangeforAcceptance,and the9000rangeforProduction.Thisis alsosafeguardagainstsomeone accidentallysendingdata tothe wrongenvironment.88 +Combining this will result in a valid XSD for my example. In your case, you will need to enter other values. When you are done with the creation of the XSD save it with a name such as spwbsrv-connector.xsd and upload it to the flow. After you have uploaded the XSD link it to the connector-xsd support object in your entry. 54 54 55 - === 3.3 ContextPath ===90 +[[image:Main.Images.Microlearning.WebHome@novice-soap-webservice-connectivity-validate-incoming-messages--uploaded-file.png]] 56 56 57 - Thefirst part of thetaticmainderof theendpoint is thecontext. By default, thisis filled with /ws but youasa useran alter this. Youcancheckthe currentue by openingtheJettycomponentagain andlooking at thetextath that is filled in.92 +[[image:Main.Images.Microlearning.WebHome@novice-soap-webservice-connectivity-validate-incoming-messages--file-linked-to-xsd-component.png]] 58 58 59 - [[image:Main.Images.Microlearning.WebHome@novice-soap-webservice-connectivity-endpoint-check--context-path.png]]94 +With this done you have successfully added validation to your SOAP web service. 60 60 61 -=== 3.4 Path Specific Servlet Mapping === 62 - 63 -The last part of our endpoint is determined by the path-specific servlet mapping. You can once again find the value (and change it if you want to) within the Jetty component. In this component, you can see the servlet mappings and see the path that belongs to that servlet. For SOAP Webservice the best practice is to have only one servlet-mapping and in 99% of the cases, the auto-generated value of eMagiz is more than fine. 64 - 65 -[[image:Main.Images.Microlearning.WebHome@novice-soap-webservice-connectivity-endpoint-check--path-specific-servlet-mapping.png]] 66 - 67 -Combining all of this, assuming we run in the eMagiz Cloud, will result in the following endpoint for our Test environment: 68 -* https://spwbsrv-test-cloud0001.emagizcloud.com/ws/spwbsrv-connector/ 69 - 70 -Combining all of this, assuming we run locally on our laptop, will result in the following endpoint for our Test environment: 71 -* http://localhost:9091/ws/spwbsrv-connector/ 72 - 73 -=== 3.5 Getting the WSDL name === 74 - 75 -To get to the WSDL to verify if it is available to be shared with external parties the last thing you need is the WSDL name. You can find this one, surprisingly enough, in the Jetty component. To get to the WSDL name double click on the servlet that is defined under the heading Servlets and navigate to the Advanced tab. Here you will see the name of the WSDL. If you have adhered to the default of eMagiz the name will mimic the name of your path-specific servlet mapping. 76 - 77 -[[image:Main.Images.Microlearning.WebHome@novice-soap-webservice-connectivity-endpoint-check--wsdl-name.png]] 78 - 79 -With this information we could reach the WSDL via the following endpoint, assuming we run in the eMagiz Cloud: 80 -* https://spwbsrv-test-cloud0001.emagizcloud.com/ws/spwbsrv-connector/spwbsrv-connector.wsdl 81 - 82 -With this information we could reach the WSDL via the following endpoint, assuming we run locally on our laptop: 83 -* http://localhost:9091/ws/spwbsrv-connector/spwbsrv-connector.wsdl 84 - 85 -With this information, you should be able to access the WSDL and communicate both the endpoint as well as the WSDL to your external parties. 86 - 87 87 == 4. Assignment == 88 88 89 - Determinetheendpoint of yourSOAP Webserviceand retrievetheWSDL.98 +Add validation to the SOAP Webservice we have been configuring. 90 90 This assignment can be completed with the help of the (Academy) project that you have created/used in the previous assignment. 91 91 92 92 == 5. Key takeaways == 93 93 94 -* Theendpointconsistsofthefollowing elements:95 - ** Starts with https://orhttp://96 - ** S econdpart is thehost (i.e. whereis the endpoint running)97 - ** Thirdparts the port onwhich the incoming traffic is accepted98 - ** Thesethreethingscombined make upthe first partof our endpoint that will vary per environment99 - *Following thatwe have a static remainderof the endpointthatisbuildup as follows: /{context-path}/{path-specific-servlet-mapping}/100 - *If you want to get to the WSDLsimplyaddthe name oftheWSDL and the .wsdl extensionto the endpoint whenviewing itinthe browser101 -* Therelevant informationcanbederivedfromtheJettycomponentandbydeterminingwhere the endpointis hosted103 +* Crucial parts in the configuration are: 104 + ** Operation Name 105 + ** SOAP Webservice Namespace 106 + ** Validation 107 + ** Authentication 108 +* Validation is done with the help of an XSD 109 +* The WSDL is used for external documentation 110 +* Use the XSD generated by eMagiz based on the system message as a starting point 102 102 103 103 == 6. Suggested Additional Readings == 104 104 ... ... @@ -106,6 +106,6 @@ 106 106 107 107 == 7. Silent demonstration video == 108 108 109 -{{video attachment="novice-soap-webservice-connectivity-en dpoint-check.mp4" reference="Main.Videos.Microlearning.WebHome"/}}118 +{{video attachment="novice-soap-webservice-connectivity-validate-incoming-messages.mp4" reference="Main.Videos.Microlearning.WebHome"/}} 110 110 111 111 )))((({{toc/}}))){{/container}}{{/container}}