Changes for page SOAP Headers
Last modified by Erik Bakker on 2024/08/26 12:48
From version 28.2
edited by Erik Bakker
on 2022/06/10 13:13
on 2022/06/10 13:13
Change comment:
Update document after refactoring.
To version 42.1
edited by Erik Bakker
on 2022/08/22 15:57
on 2022/08/22 15:57
Change comment:
There is no comment for this version
Summary
-
Page properties (3 modified, 0 added, 0 removed)
Details
- Page properties
-
- Title
-
... ... @@ -1,1 +1,1 @@ 1 - novice-file-based-connectivity-processing-a-file-per-line1 +SOAP Headers - Default language
-
... ... @@ -1,0 +1,1 @@ 1 +en - Content
-
... ... @@ -1,70 +1,66 @@ 1 1 {{container}}{{container layoutStyle="columns"}}((( 2 - Inthismicrolearning,wewilllearn howyoucandefine a headerlinein whichyou specifythenaming ofthevariouscolumns. Someexternalsystemsrequireaheaderlinewhenyousupplythemwithdataviaaflatfilehatsplaced somewhere.2 +When communicating via SOAP web service calls it can happen that an exchange of data needs to happen between the message headers on your message and the SOAP headers. In this microlearning, we will learn about this exchange in both directions. SOAP Headers are headers within a SOAP Envelope that can be used to communicate metadata or authentication information between parties. 3 3 4 -Should you have any questions, please contact [[academy@emagiz.com>>mailto:academy@emagiz.com]].4 +Should you have any questions, please contact academy@emagiz.com. 5 5 6 -* Last update: May 28th, 2021 7 -* Required reading time: 5 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 SOAP Headers. 14 14 15 - This microlearningcentersaroundlearninghowtoplacea headerlineaflat-fileoutput.12 +By SOAP Headers, we mean: headers within a SOAP Envelope that can be used to communicate metadata or authentication information between parties 16 16 17 -By header line we mean: A line in the output that defines the naming of the various columns 14 +You can exchange data from: 15 +* SOAP Header to Message Header 16 +* Message Header to SOAP Header 18 18 19 - Someexternalpartiesrequire that thefirstline in theflatfileoutput(i.e. CSV) isfilled withcolumn names (i.e.headers). IneMagiz, wecall this line a header line.18 +In both cases ensure that the correct information is exchanged. 20 20 21 -== 3. Header line==20 +== 3. SOAP Headers == 22 22 23 - Inthismicrolearning,wewill learnhow youcandefinea header linein whichyouspecify the naming of the variouscolumns.Some externalsystemsrequireaheaderlinewhenyou supplythemwithdataviaaflatfilethat isplacedsomewhere.Theheaderlineis thefirstlineinthe flatfileoutput.Withinthisline,thevarious columnnamesarespecifiedforclarity.22 +When communicating via SOAP web service calls it can happen that an exchange of data needs to happen between the message headers on your message and the SOAP headers. In this microlearning, we will learn about this exchange in both directions. SOAP Headers are headers within a SOAP Envelope that can be used to communicate metadata or authentication information between parties. 24 24 25 -To add such a header line in eMagiz you need to navigate to the Create phase of eMagiz and open the exit flow in which you want to drop the file to a certain location. Within the context of this flow, we need to add functionality that will ensure that a header line is written to the output before any functional lines are added. To do so first enter "Start Editing" mode on flow level. After you have done so please add a file outbound channel adapter to the flow including an input channel. We will use this component to write our header line to the flat file output. 24 +You can exchange data from: 25 +* SOAP Header to Message Header 26 +* Message Header to SOAP Header 26 26 27 - Ensure that thedirectory to which youreference isthesame asinyourfunctionalfileoutboundchannel adapter.28 +In both cases ensure that the correct information is exchanged. 28 28 29 - [[image:Main.Images.Microlearning.WebHome@novice-file-based-connectivity-header-line--file-outbound-channel-header-line.png]]30 +In a previous microlearning, we already discussed one aspect of this. As you probably recall from our microlearning on [[Securing your SOAP Webservice>>doc:Main.eMagiz Academy.Microlearnings.Novice.SOAP Web service Connectivity.novice-soap-webservice-connectivity-securing-your-soap-webservice.WebHome||target="blank"]] we needed to exchange data between the SOAP header that our client was sending and a message header on the message so we could check whether or not the client was authorized to call the operation. 30 30 31 - Now it is time to turnour attention to the Advancedtab.Forthe Mode select Ignore. Select this optiontoensurethat the headerline isnlywrittendownonce whenthereis nooutput createdyetnd notsomewhereinthemiddle, in the end,oreverytime.Furthermore,select theoptionAppendNew Line to ensure that theremainderof the information is not appended to the same line.32 +In that microlearning, we also discussed the component that we need for this. The 'complex SOAP header mapper'. 32 32 33 -[[image:Main.Images.Microlearning.WebHome@novice- file-based-connectivity-header-line--file-outbound-channel-header-line-advanced.png]]34 +[[image:Main.Images.Microlearning.WebHome@novice-soap-webservice-connectivity-soap-headers--complex-soap-header-mapper.png]] 34 34 35 -A fteryouhave doneso weneedto addastandardtransformerthatdefines thevariouscolumnnamestobewrittentotheflat fileoutput. Todoso addthe standardtransformer component to the canvasincludinganinput channel.Afteryouhave done so define therelevantSpELexpression.In this case,we adviseusingapropertyvalue thatrepresents astringofcolumnnames. The valueofthepropertyshouldbe something asfollows:36 +As you can see you can map from and to message headers with regards to the SOAP Headers. As we already discussed the first scenario in an earlier microlearning I will for now continue with the other scenario. This scenario is mainly needed when eMagiz calls a SOAP web service that is hosted by an external party. Since we would normally do this in an exit (gate/flow) let us open such an exit in eMagiz and enter "Start Editing" mode. 36 36 37 - 'Header1;Header2;Header3;Header4'38 +The first step we need to take is to ensure that the information that we need to send to the SOAP web service in question (in this a unique reference number) is available in a message header. This can be done by verifying in all steps that preceded before the message entered the exit whether or not this piece of information was already added to a message header. In this case, we assume that this is the case since we want to focus on the 'complex SOAP header mapper' component and its relation to the web services outbound gateway. To correctly exchange data from a message header to a SOAP header we need to define a valid SpEL expression. See the help text of the component for a suggestion of what a valid SpEL expression is. The key part in this is knowing how the external party wants to receive the header(s) and how you (or one of your colleagues) has named the message header. When you have those two information elements you can write the correct expression. The result should be something as follows: 38 38 39 - Do note that theseparator,inthis case, needsto match therequirementsf thexternal system. At the flowconfigurationlevel,thestandard transformershould lookas follows.40 +[[image:Main.Images.Microlearning.WebHome@novice-soap-webservice-connectivity-soap-headers--mapping-from-message-header.png]] 40 40 41 - [[image:Main.Images.Microlearning.WebHome@novice-file-based-connectivity-header-line--define-columns-names.png]]42 +Once you are satisfied you can press Save and link the support object to the web service outbound gateway. 42 42 43 - Our last stepisto ensure thatthispiece of logic is tied to the mainlow and is executed before writing the functional line(s) to the output file. Tomakethat happen we need to add a wiretap tothe flow. With the help of this functionality, you candefine whichpart of thelogic takes precedenceoveranother part of the logic. Todosodouble click onthechannelon which you want to placewiretap,selectthe option wiretap andselect thecorrect wiretapchannel. Afterouhave donethis theresult shouldbesomethingas follows:44 +With this information, you can place SOAP Headers on message headers and vice versa every time you need it. 44 44 45 -[[image:Main.Images.Microlearning.WebHome@novice-file-based-connectivity-header-line--wiretap-result.png]] 46 - 47 -With these couple of steps, you have now successfully added logic to your flow that will ensure that a header line is added before any functional line(s) are written to the output file. 48 - 49 49 == 4. Assignment == 50 50 51 -C onfigurean exitin whichyou define andwritea headerlinetoa flat-fileoutputbeforeadding functional lines.48 +Call an external web service and send along some SOAP Headers. 52 52 This assignment can be completed with the help of the (Academy) project that you have created/used in the previous assignment. 53 53 54 54 == 5. Key takeaways == 55 55 56 -* The header line contains the names of the columns of the flat file output 57 -* Use the Ignore mode to ensure the header line is created once 58 -* Use the wiretap to ensure the header line is created first 53 +* You can exchange data from: 54 + ** SOAP Header to Message Header 55 + ** Message Header to SOAP Header 56 +* You need the SOAP structure and the message header name to make it work 59 59 60 60 == 6. Suggested Additional Readings == 61 61 62 - Thereare no suggestedadditionalreadingsonthis topic60 +If you are interested in this topic and want more information on it please read the help text provided by eMagiz. 63 63 64 64 == 7. Silent demonstration video == 65 65 66 - Thisvideodemonstrates how you could have handledtheassignmentand givesyousometexton whatuhavejustlearned.64 +{{video attachment="novice-soap-webservice-connectivity-soap-headers.mp4" reference="Main.Videos.Microlearning.WebHome"/}} 67 67 68 -{{video attachment="novice-file-based-connectivity-header-line.mp4" reference="Main.Videos.Microlearning.WebHome"/}} 69 - 70 70 )))((({{toc/}}))){{/container}}{{/container}}