Endpoint Check
In this microlearning, we will discuss setting up a communication point for customers using eMagiz, hosting a SOAP Webservice, checking endpoint availability, and understanding the components of the endpoint URL.
Should you have any questions, please contact academy@emagiz.com.
1. Prerequisites
- Basic knowledge of the eMagiz platform
2. Key concepts
This microlearning centers around the endpoint check.
By endpoint check, we mean: determine whether the WSDL is accessible on the correct endpoint so we can forward the URL to the WSDL + the URL to call to our external parties
- The endpoint consists of the following elements:
- Starts with https:// or http://
- Second part is the host (i.e. where is the endpoint running)
- Third part is the port on which the incoming traffic is accepted
- These three things combined make up the first part of our endpoint that will vary per environment
- Following that we have a static remainder of the endpoint that is build up as follows: /{soap WS name}/{Id}/
- If you want to get to the WSDL simply add the name of the WSDL (which is defined by the Id given to the "Dynamic WSDL" support object) and the .wsdl extension to the endpoint when viewing it in the browser
3. Endpoint Check
When setting up a point where your customers can talk to you, eMagiz offers various methods for creating such a point. One option is hosting a SOAP Webservice in eMagiz that handles XML messages asynchronously or synchronously. One last check to perform before you can communicate with the external parties that the endpoint is available to receive messages and is up and running. In this microlearning, we will learn how you can perform such a check.
- The endpoint consists of the following elements:
- Starts with https:// or http://
- The second part is the host (i.e., where the endpoint is running)
- The third part is the port on which the incoming traffic is accepted
- These three things combined make up the first part of our endpoint, which will vary per environment
- Following that, we have a static remainder of the endpoint that is built up as follows: /{soap WS name}/{Id}/
- If you want to get to the WSDL, add the name of the WSDL (which is defined by the ID given to the "Dynamic WSDL" support object) and the .wsdl extension to the endpoint when viewing it in the browser
As you can see, the endpoint can be divided into two parts. One part is dynamic across environments, and one part is static across environments. Let us first determine how to find the first part of our endpoint.
3.1 HTTPS or HTTP
We start at the top with the determination of HTTPS or HTTP. A simple rule of thumb is that when running in the eMagiz Cloud, the endpoint starts with https://, and when running locally (i.e., on-premise), the endpoint starts with http:// (unless you secure it yourself; more on that later).
3.2 Host
The next part of the endpoint is the host. The host is the (virtual) machine on which the endpoint runs. When hosting an endpoint in the eMagiz cloud, the host part is the combination of the DNS left-most label on the Route level and the cloud slot on which your environment is running. The first part of the equation can be found under Deploy -> Architecture. The second part can be found under Deploy -> Properties by looking for the {technicalnameproject}.amqp01.host. You need to combine the two elements via a dash -. An example of this is spwbsrv-test-cloud0001.emagizcloud.com. In an on-premise installation, you should ask your customer what the IP address or DNS name is to connect to the machine on which your runtime is running. If the runtime runs locally on your laptop, the host equals localhost.
3.3 Port and Path
The location determines whether or not the port needs to be defined to get to the endpoint. If the endpoint is hosted in the eMagiz Cloud, the port is *not* part of the endpoint. However, when you host your endpoint locally, the endpoint becomes part of your endpoint. Set up your route properly to make this piece work in the eMagiz Cloud. More on that in our Cloud Management courses. You can determine the port for the endpoint or the route by navigating to the infra flow of the runtime through which you host your SOAP web service. You can also find the remainder of the path to the WSDL location in the "infra flow."
The infra flow has a support object of the type "Dynamic WSDL". Here, you see the default location of the hosted SOAP endpoint, which is http://localhost:${entry.connector.ws.port}/ws/{soap WS name}/. Based on this, you can find the WSDL by adding {Id}.wsdl to the URI. In this example, when hosting the SOAP web service on-premise, a valid URI would be http://localhost:8099/ws/soapgn3-connector/soapgn3-connector.wsdl.
4. Key takeaways
- The endpoint consists of the following elements:
- Starts with https:// or http://
- The second part is the host (i.e., where the endpoint is running)
- The third part is the port on which the incoming traffic is accepted
- These three things combined make up the first part of our endpoint, which will vary per environment
- Following that, we have a static remainder of the endpoint that is built up as follows: /{soap WS name}/{Id}/
- If you want to get to the WSDL, add the name of the WSDL (which is defined by the ID given to the "Dynamic WSDL" support object) and the .wsdl extension to the endpoint when viewing it in the browser
- The relevant information can be derived from the "Dynamic WSDL" support object and by determining where the endpoint is hosted