Changes for page Endpoint Check
Last modified by Danniar Firdausy on 2024/09/04 10:26
From version 39.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 37.1
edited by Erik Bakker
on 2022/06/12 09:37
on 2022/06/12 09:37
Change comment:
There is no comment for this version
Summary
-
Page properties (2 modified, 0 added, 0 removed)
Details
- Page properties
-
- Title
-
... ... @@ -1,1 +1,1 @@ 1 - EndpointCheck1 +SOAP Headers - Content
-
... ... @@ -1,104 +1,62 @@ 1 1 {{container}}{{container layoutStyle="columns"}}((( 2 -When settingup a pointatwhichyourcustomerscantalktoyoueMagizoffersvariousmethods ofcreating suchoint.Oneofthoseoptionsisbyhosting a SOAPWebserviceineMagizthat handlesXMLmessagesasynchronouslyorsynchronously.Onelastchecktoperformbeforeyou can communicate withtheexternalartiesthattheendpointisavailable toreceive messages andupandrunning. Inthismicrolearning,weill learnhow you canperform suchacheck.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 4 Should you have any questions, please contact academy@emagiz.com. 5 5 6 -* Last update: June 1 1th, 20217 -* Required reading time: 7minutes6 +* Last update: June 10th, 2021 7 +* Required reading time: 5 minutes 8 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 theendpoint check.13 +This microlearning centers around SOAP Headers. 14 14 15 -By e ndpoint check, we mean: determinewhethertheWSDLis accessibleonthecorrectendpointsowecan forwardtheURLtotheWSDL+theURLtocallto our externalparties15 +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 -The endpoint consists of the following elements: 18 -* Starts with https:// or http:// 19 -* Second part is the host (i.e. where is the endpoint running) 20 -* Third part is the port on which the incoming traffic is accepted 21 -* These three things combined make up the first part of our endpoint that will vary per environment 22 -* Following that we have a static remainder of the endpoint that is build up as follows: /ws/{path-specific-servlet-mapping}/ 23 -* 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 17 +You can exchange data from: 18 +* SOAP Header to Message Header 19 +* Message Header to SOAP Header 20 + 21 +In both cases ensure that the correct information is exchanged. 24 24 25 -== 3. EndpointCheck==23 +== 3. SOAP Headers == 26 26 27 -hen settingup a pointatwhichyourcustomerscantalktoyoueMagizoffersvariousmethods ofcreating suchoint.Oneofthoseoptionsisbyhosting a SOAPWebserviceineMagizthat handlesXMLmessagesasynchronouslyorsynchronously.Onelastchecktoperformbeforeyou can communicate withtheexternalartiesthattheendpointisavailable toreceive messages andupandrunning. Inthismicrolearning,weill learnhow you canperform suchacheck.25 +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. 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 27 +You can exchange data from: 28 +* SOAP Header to Message Header 29 +* Message Header to SOAP Header 36 36 37 - Asyoucanseetheendpoint can bedivided into two parts.Onepart is dynamicacross environmentsandone part is static across environments.Let us firstdetermine how wecan find out the first part of our endpoint.31 +In both cases ensure that the correct information is exchanged. 38 38 39 - ===3.1HTTPS orHTTP===33 +In a previous microlearning, we already discussed one aspect of this. As you probably recall from our microlearning on [Securing your SOAP Webservice](novice-soap-web service-connectivity-securing-your-soap-webservice.md) 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. 40 40 41 - Westartat the top with the determination of HTTPS orHTTP. A simplerule of thumb is that whenrunningin theeMagiz Cloud theendpointstartswithhttps:// and when theendpointis running locally (i.e. on-premise)the endpointstartswithhttp:// (unlessyousecureit yourself,more on that later).35 +In that microlearning, we also discussed the component that we need for this. The 'complex SOAP header mapper'. 42 42 43 - === 3.2Host===37 +[[image:Main.Images.Microlearning.WebHome@novice-soap-webservice-connectivity-soap-headers--complex-soap-header-mapper.png]] 44 44 45 - Thenext partofthe endpointisthehost. Thehostis effectively the (virtual)machineonwhich the endpointisrunning. Whenhosting anendpointintheeMagiz cloud the host part is the combinationbetween theDNSleft-most labelonRoute levelandthe cloudslot on which yourenvironmentis running. The firstpartofthe equationcanbefound underDeploy -> Architecture.The second part canbefound underDeploy-> Propertiesby lookingforthe{technicalnameproject}.amqp01.host.You need tocombinethetwoelementsvia adash(-).Anexample of thiswould thenbespwbsrv-test-cloud0001.emagizcloud.com.In caseofanon-premiseinstallation,youshouldask yourcustomer whatthe IP addressorDNS nameistoconnect tothemachineonwhichyour runtimeisrunning.Iftheruntimeisrunninglocally on yourlaptopthehostequals localhost.39 +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. 46 46 47 - ===3.3Port===41 +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: 48 48 49 - Whether or not the port needs to be defined to get to the endpoint is onceagain determined by the location.f theendpoint ishosted in the eMagiz Cloud the port is *not* part of the endpoint.wever, whenyou host your endpoint locally theendpoint becomespartof your endpoint. Note that to make thispiecework in theeMagiz Cloud youshould set up yourRoute properly. More on thatin our Cloud Managementcourses. Youcan determine the port, for the endpoint or theroute,in two steps. First, we navigate totheall entry wehavecreatedand open the Jetty component. The first segment ofthe Jetty Server talks about theerver connector. In thispart, theport is defined (either viaa property or statically).43 +[[image:Main.Images.Microlearning.WebHome@novice-soap-webservice-connectivity-soap-headers--mapping-from-message-header.png]] 50 50 51 - [[image:Main.Images.Microlearning.WebHome@novice-soap-webservice-connectivity-endpoint-check--server-connector-settings.png]]45 +Once you are satisfied you can press Save and link the support object to the web service outbound gateway. 52 52 53 - Ifitis defined via a property you can searchforthe corresponding value under Deploy -> Propertiesby checkingon the property nameand filteringonruntime level to get to the port. If it is defined staticallyyou cansimply read it here. Note that the best practiceisto useproperty value asthat allows you to use a differentrange for your port numbering between environments. In other words, itallows you to usethe9000 rangeforTest,the 8000 rangefor Acceptance,and the9000rangeforProduction.This is alsoto safeguardagainst someoneaccidentallysending data to the wrong environment.47 +With this information, you can place SOAP Headers on message headers and vice versa every time you need it. 54 54 55 -=== 3.3 Context Path === 56 - 57 -The first part of the static remainder of the endpoint is the context. By default, this is filled with /ws but you as a user can alter this. You can check the current value by opening the Jetty component again and looking at the context path that is filled in. 58 - 59 -[[image:Main.Images.Microlearning.WebHome@novice-soap-webservice-connectivity-endpoint-check--context-path.png]] 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 - Determinethe endpointofyourSOAPWebserviceandretrieve the WSDL.51 +Call an external web service and send along some SOAP Headers. 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 -* The endpoint consists of the following elements: 95 - ** Starts with https:// or http:// 96 - ** Second part is the host (i.e. where is the endpoint running) 97 - ** Third part is the port on which the incoming traffic is accepted 98 - ** These three things combined make up the first part of our endpoint that will vary per environment 99 - ** Following that we have a static remainder of the endpoint that is build up as follows: /{context-path}/{path-specific-servlet-mapping}/ 100 - ** 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 101 -* The relevant information can be derived from the Jetty component and by determining where the endpoint is hosted 56 +* You can exchange data from: 57 + ** SOAP Header to Message Header 58 + ** Message Header to SOAP Header 59 +* You need the SOAP structure and the message header name to make it work 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- endpoint-check.mp4" reference="Main.Videos.Microlearning.WebHome"/}}67 +{{video attachment="novice-soap-webservice-connectivity-soap-headers.mp4" reference="Main.Videos.Microlearning.WebHome"/}} 110 110 111 111 )))((({{toc/}}))){{/container}}{{/container}}