Changes for page Validate Incoming Messages
Last modified by Erik Bakker on 2024/08/26 12:39
From version 30.1
edited by Erik Bakker
on 2022/06/10 13:22
on 2022/06/10 13:22
Change comment:
There is no comment for this version
To version 49.1
edited by Eva Torken
on 2023/06/27 11:16
on 2023/06/27 11:16
Change comment:
There is no comment for this version
Summary
-
Page properties (5 modified, 0 added, 0 removed)
Details
- Page properties
-
- Title
-
... ... @@ -1,1 +1,1 @@ 1 - ProcessingaFileper Line1 +Validate Incoming Messages - Parent
-
... ... @@ -1,1 +1,1 @@ 1 -WebHome 1 +Main.eMagiz Academy.Microlearnings.Novice.SOAP Web service Connectivity.WebHome - Author
-
... ... @@ -1,1 +1,1 @@ 1 -XWiki.e bakker1 +XWiki.etorken - Default language
-
... ... @@ -1,0 +1,1 @@ 1 +en - Content
-
... ... @@ -1,104 +1,66 @@ 1 1 {{container}}{{container layoutStyle="columns"}}((( 2 - In somecases, youwanttoreateach uniquepart ofyourinputfileas its messageinsteadofprocessingthecompletefileasits message. In this microlearning, we willlearnhowyou canprocess(large)fileona per-linebasis.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 to host 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 - Shouldyou have any questions,please contact[[academy@emagiz.com>>mailto:academy@emagiz.com]].4 +If you have any questions, don't hesitate to contact academy@emagiz.com. 5 5 6 -* Last update: May 31th, 2021 7 -* Required reading time: 7 minutes 8 - 9 9 == 1. Prerequisites == 10 - 11 11 * Basic knowledge of the eMagiz platform 12 12 13 13 == 2. Key concepts == 10 +This microlearning centers around configuring your SOAP web service. 14 14 15 - Thismicrolearningcenters aroundlearning howto process anincomingfileperline.12 +By configuring, we mean: Designing and determining the characteristics of the SOAP web service. 16 16 17 -By processing per line, we mean: Splitting up the input into discernable pieces that each will become a unique message 14 +Crucial parts in the configuration are: 15 +* Operation Name 16 +* SOAP Webservice Namespace 17 +* Validation 18 +* Authentication 18 18 19 -* Easy way of reading a file line by line and sending it to eMagiz (Low on memory) 20 -* Ability to process each line based on distinctive logic that is relevant on line level 21 -* Can be used for flat file as well as XML input files 20 +Of these four points, we will zoom in on the validation part of our SOAP Webservice in this microlearning. 22 22 23 -== 3. Processing aFileper Line==22 +== 3. Validate Incoming Messages == 24 24 25 - In somecases, youwanttoreateach uniquepart ofyourinputfileas its messageinsteadofprocessingthecompletefileasits message. In this microlearning, we willlearnhowyou canprocess(large)fileona per-linebasis.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 to host 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. 26 26 27 -To make this work in eMagiz you need to navigate to the Create phase of eMagiz and open the entry flow in which you want to retrieve the file to a certain location. Within the context of this flow, we need to add functionality that will ensure that each line is read and processed separately and will become its unique message. To do so first enter "Start Editing" mode on flow level. After you have done so please add a file item reader message source to the flow. We will use this component to read and process our input file on a per-line basis. 26 +Crucial parts in the configuration are: 27 +* Operation Name 28 +* SOAP Webservice Namespace 29 +* Validation 30 +* Authentication 28 28 29 - The firststepwould be todefinethedirectoryfromwhichwe readourmessages.Asalwaysreference to thedirectorywiththe help ofaproperty.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 proper credentials (security) and the correct answers (validation) can enter and perform their actions. In the previous microlearning, we talked about the validation part. In this microlearning, we talk about the security part. 30 30 31 - [[image:Main.Images.Microlearning.WebHome@novice-file-based-connectivity-processing-a-file-per-line--file-item-reader-directory.png]]34 +=== 3.1 Configuration on system message level in Design === 32 32 33 - Secondly,just as when readingthefile as a whole ensure that you use afilter to retrieve onlythecorrectfilesfrom thedirectory.36 +As you have learned from the crash course, you can validate an XML message with the help of an XSD. This XSD describes data types, order, associations, and length of attributes. You can use such an XSD to validate what your clients send you. eMagiz will automatically define a WSDL based on the combination of system messages you provide for each operation you want to host. To ensure that the WSDL is created correctly, don't forget to add an entity called "Send{givenname}Request" to the (request) system message and an entity called "Send{givenname}Response" in case you have a response system message. An example of how this needs to be configured in Design is shown below. 34 34 35 - === 3.1ItemType ===38 +[[image:Main.Images.Microlearning.WebHome@novice-soap-webservice-connectivity-validate-incoming-messages-gen3--root-entity-for-wsdl.png]] 36 36 37 - Nowit is time to select our Item reader Type.As the help text ofthe eMagiz component suggest there are two choices with this component. Thefirst (and most frequently used) option is the Flat file item reader. With this option, youcan read each line withinthe flat file inputfile and output is at a separatemessage. The second option is calledthe Stax event item reader. With this option, you can read your input XML and output messages on a per-record basis.40 +=== 3.2 Effect in Create === 38 38 39 - [[image:Main.Images.Microlearning.WebHome@novice-file-based-connectivity-processing-a-file-per-line--item-reader-type-options.png]]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. 40 40 41 - Based onyourchoicethexactconfigurationwilldiffer.44 +[[image:Main.Images.Microlearning.WebHome@novice-soap-webservice-connectivity-validate-incoming-messages-gen3--dynamic-wsdl-support-object-infra.png]] 42 42 43 - ====3.1.1 StaxEventItemReader====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}} 44 44 45 - For the Stax eventitem reader, you need to define thename ofthe element on which you want tosplitthe XML anddefinewhetheryouwant to throwanerrorin case no suchelement existsin the inputfile (By(de)selectingthe optionStrict).The defaultsettingofeMagizisadvisableforthis option.48 +With this done, you have successfully added validation to your SOAP web service. 46 46 47 - [[image:Main.Images.Microlearning.WebHome@novice-file-based-connectivity-processing-a-file-per-line--stax-event-item-reader-config.png]]50 +== 4. Key takeaways == 48 48 49 -==== 3.1.2 Flat File Item Reader ==== 52 +* Crucial parts in the configuration are: 53 + ** Operation Name 54 + ** SOAP Webservice Namespace 55 + ** Validation 56 + ** Authentication 57 +* Validation is done with the help of an XSD 58 +* The WSDL is used for external documentation 59 +* eMagiz will automatically generate the WSDL for you based on your system messages 60 +** Do not forget to add the correct root entity to your system message to make the WSDL work 50 50 51 -For the Flat File item reader, there are some more choices and configurations to be made. There are three options you can choose from: 52 -- Pass through line mapper 53 -- Default line mapper 54 -- Pattern matching composite line mapper 62 +== 5. Suggested Additional Readings == 55 55 56 - Each oftheseoptionshas someadvantages and disadvantages. Adhering to thebestpracticesof eMagiz (i.e.notransformation in the entry) the best option would be to usethe pass-through line mapper. As the name suggests this option does nothing exceptgiveastringbacktothe flow on a perlinebasis. However, choosing this option means that the actual transformationfrom that string to XML needs to happenlater in the process (most likelyin the onramp)withthe helpof a flat-fileoXML transformer(moreon that component inalater course).64 +If you are interested in this topic and want more information, please read the help text provided by eMagiz. 57 57 58 -The other two options transform the input line into an XML output. So you win one step in the process. However, no standard eMagiz error handling is advisable when you start transforming data within the entry. So in case, something goes wrong to analyze the error will become more difficult. Furthermore, another potential disadvantage is that when one line fails the processing of the rest of the file also halts. 59 - 60 -For the remainder of this microlearning, we will assume that the option pass through line mapper is chosen. 61 - 62 -[[image:Main.Images.Microlearning.WebHome@novice-file-based-connectivity-processing-a-file-per-line--flat-file-item-reader-passthrough.png]] 63 - 64 -As you can see on the Basic level we are done. However, it is always good to check out the settings on the Advanced tab, especially in this case, to see if there are additional configuration options that could benefit us. The setting of most interest, in this case, is the Lines to Skip setting (default setting is 0). With this setting, you can define whether or not you want to process the header line(s) that exists within your input file. The remainder of the settings is (in most cases) good the way eMagiz has set them up. 65 - 66 -[[image:Main.Images.Microlearning.WebHome@novice-file-based-connectivity-processing-a-file-per-line--flat-file-item-reader-passthrough-advanced.png]] 67 - 68 -=== 3.2 Poller === 69 - 70 -Now that we have selected and configured the item reader type it becomes time to fill in the last part of the configuration, the poller. For polling eMagiz offers three options: 71 - 72 -- Fixed Delay Trigger 73 -- Fixed Rate Trigger 74 -- Cron Trigger 75 - 76 -Of these options, the cron trigger is used most frequently in eMagiz. The reason being is that you can define this option via a property that you can alter without having to alter the flow version in Create. 77 - 78 -[[image:Main.Images.Microlearning.WebHome@novice-file-based-connectivity-processing-a-file-per-line--poller-config.png]] 79 - 80 -After finishing all these configuration steps we can press Save to save our work and ensure that we can process the input file on a per-line basis. 81 - 82 -== 4. Assignment == 83 - 84 -Configure an entry in which you define the component and configuration needed to process a file on a per-line basis. 85 -This assignment can be completed with the help of the (Academy) project that you have created/used in the previous assignment. 86 - 87 -== 5. Key takeaways == 88 - 89 -* Easy way of reading a file line by line and sending it to eMagiz (Low on memory) 90 -* Ability to process each line based on distinctive logic that is relevant on line level 91 -* Can be used for flat file as well as XML input files 92 -* Try to avoid complex transformations within the entry 93 - 94 -== 6. Suggested Additional Readings == 95 - 96 -There are no suggested additional readings on this topic 97 - 98 -== 7. Silent demonstration video == 99 - 100 -This video demonstrates how you could have handled the assignment and gives you some context on what you have just learned. 101 - 102 -{{video attachment="novice-file-based-connectivity-processing-a-file-per-line.mp4" reference="Main.Videos.Microlearning.WebHome"/}} 103 - 104 104 )))((({{toc/}}))){{/container}}{{/container}}