Changes for page Validate Incoming Messages
Last modified by Erik Bakker on 2024/08/26 12:39
From version 44.1
edited by Erik Bakker
on 2022/12/30 12:09
on 2022/12/30 12:09
Change comment:
There is no comment for this version
To version 42.1
edited by Carlijn Kokkeler
on 2022/10/05 13:01
on 2022/10/05 13:01
Change comment:
There is no comment for this version
Summary
-
Page properties (3 modified, 0 added, 0 removed)
Details
- Page properties
-
- Parent
-
... ... @@ -1,1 +1,1 @@ 1 - Main.eMagiz Academy.Microlearnings.Novice.SOAPWebservice Connectivity.WebHome1 +WebHome - Author
-
... ... @@ -1,1 +1,1 @@ 1 -XWiki. ebakker1 +XWiki.CarlijnKokkeler - Content
-
... ... @@ -1,7 +1,7 @@ 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 istohost 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.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 - Ifyou have any questions,don't hesitatetocontact academy@emagiz.com.4 +Should you have any questions, please contact academy@emagiz.com. 5 5 6 6 == 1. Prerequisites == 7 7 * Basic knowledge of the eMagiz platform ... ... @@ -9,7 +9,7 @@ 9 9 == 2. Key concepts == 10 10 This microlearning centers around configuring your SOAP web service. 11 11 12 -By configuring, we mean: Designing and determining the characteristics of the SOAP web service .12 +By configuring, we mean: Designing and determining the characteristics of the SOAP web service 13 13 14 14 Crucial parts in the configuration are: 15 15 * Operation Name ... ... @@ -21,7 +21,7 @@ 21 21 22 22 == 3. Validate Incoming Messages == 23 23 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 istohost 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.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. In this microlearning, we will zoom in on the part that validation of the messages plays when offering such a SOAP web service. 25 25 26 26 Crucial parts in the configuration are: 27 27 * Operation Name ... ... @@ -29,32 +29,77 @@ 29 29 * Validation 30 30 * Authentication 31 31 32 -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 propercredentials (security) and thecorrect answers (validation)canenter and perform their actions. In thepreviousmicrolearning, we talkedabout the security part. In this microlearning, we talk about the validation part.32 +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. 33 33 34 - ===3.1Configuration on systemmessage level inDesign===34 +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:~//localhost:port/ws/ws-name/ws-name.wsdl". Note that you need to replace all values (except for the ws and .wsdl part) with actual values. 35 35 36 - As youhavelearned from the crash course,youcanvalidate an XML message with the helpof anXSD.ThisXSDdescribes datatypes, order, associations, and lengthof attributes.Youcan use suchanXSD tovalidatewhatyour clients send you. eMagizwillautomaticallydefineWSDLbased on thecombination ofsystem messages youprovide foreachoperation youwanttohost.Toensure that theWSDLiscreated correctly,don'tforget toadd an entity called"Send{givenname}Request"tothe(request)systemmessageandanentitycalled "Send{givenname}Response"in caseyouhave a responsesystemmessage. An example ofhow thisneedstobe configuredinDesignis shownbelow.36 +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: 37 37 38 -[[image:Main.Images.Microlearning.WebHome@novice-soap-webservice-connectivity-validate-incoming-messages-gen3--root-entity-for-wsdl.png]] 38 +{{code language="xml"}} 39 +<?xml version="1.0" encoding="UTF-8" standalone="yes"?> 40 +<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" 41 + xmlns="http://www.academy.emagiz.com/ns/mlacade-bus/spwbsrv-connector/1.0/" 42 + attributeFormDefault="unqualified" elementFormDefault="unqualified" 43 + targetNamespace="http://www.academy.emagiz.com/ns/mlacade-bus/spwbsrv-connector/1.0/"> 44 +{{/code}} 39 39 40 - ===3.2Effect inCreate===46 +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: 41 41 42 -In the infra flow, eMagiz automatically adds a support object of the "Dynamic WSDL" type. In this support object, the link is made between the system message definitions and the WSDL that will be created based on this. 48 +{{code language="xml"}} 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> 73 +{{/code}} 43 43 44 - [[image:Main.Images.Microlearning.WebHome@novice-soap-webservice-connectivity-validate-incoming-messages-gen3--dynamic-wsdl-support-object-infra.png]]75 +To wrap things up you need to define your Request and Response element and close the schema: 45 45 46 -{{warning}}Note that when you make changes to the system message after the integration is already in Create, or when you add a new integration to Create, you need to create a new version of your infra flow to be able to deploy the changes to your WSDL.{{/warning}} 77 +{{code language="xml"}} 78 +<xs:element name="SendNptRequest"> 79 + <xs:complexType> 80 + <xs:sequence> 81 + <xs:element name="Input" type="Input"/> 82 + </xs:sequence> 83 + </xs:complexType> 84 + </xs:element> 85 + <xs:element name="SendNptResponse"> 86 + <xs:complexType/> 87 + </xs:element> 88 + </xs:schema> 89 +{{/code}} 47 47 48 - In thissamesupportobject,youalsoseethedefaultlocation ofthe hostedSOAP endpoint,whichishttp://localhost:${entry.connector.ws.port}/ws/{soapWS name}/.Basedon this,youcan findtheWSDLby adding {soap WS name}.wsdltotheURI.Inthis example,whenhostingthe SOAPweberviceon-premise,avalidURIwouldbe"http://localhost:8099/ws/soapgn3-connector/soapgn3-connector.wsdl".91 +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. 49 49 50 - {{info}}Note that when runningyour webservicetheMagizcloud, thefirst part (thehost part) willchangedepending on yourconfigurationin Deploy Architectureand the cloudsloton which you are running. An exampleURI, in that case, would be "https://soap-test-cloud0000.emagizcloud.com/ws/soapgn3-connector/soapgn3-connector.wsdl"{{/info}}93 +[[image:Main.Images.Microlearning.WebHome@novice-soap-webservice-connectivity-validate-incoming-messages--uploaded-file.png]] 51 51 52 - With thisdone, you haveuccessfullyaddedvalidationtoyour SOAP webservice.95 +[[image:Main.Images.Microlearning.WebHome@novice-soap-webservice-connectivity-validate-incoming-messages--file-linked-to-xsd-component.png]] 53 53 97 +With this done you have successfully added validation to your SOAP web service. 98 + 54 54 == 4. Assignment == 55 55 56 56 Add validation to the SOAP Webservice we have been configuring. 57 -This assignment can be completed with the help of the (Academy) project you created/used in the previous assignment. 102 +This assignment can be completed with the help of the (Academy) project that you have created/used in the previous assignment. 58 58 59 59 == 5. Key takeaways == 60 60 ... ... @@ -61,16 +61,15 @@ 61 61 * Crucial parts in the configuration are: 62 62 ** Operation Name 63 63 ** SOAP Webservice Namespace 64 - ** validationvalidation109 + ** Validation 65 65 ** Authentication 66 66 * Validation is done with the help of an XSD 67 67 * The WSDL is used for external documentation 68 -* eMagiz will automatically generate the WSDL for you based on your system messages 69 -** Do not forget to add the correct root entity to your system message to make the WSDL work 113 +* Use the XSD generated by eMagiz based on the system message as a starting point 70 70 71 71 == 6. Suggested Additional Readings == 72 72 73 -If you are interested in this topic and want more information ,please read the help text provided by eMagiz.117 +If you are interested in this topic and want more information on it please read the help text provided by eMagiz. 74 74 75 75 == 7. Silent demonstration video == 76 76