Handling Webservice Timeouts

Last modified by Danniar Firdausy on 2024/09/18 21:36

In our previous module, we explored how to call a SOAP web service and manage detailed faults. Building on that foundation, this microlearning will focus on addressing web service timeouts from external parties. We’ll cover how to adjust the default timeout settings in eMagiz using the HTTP Components message sender to ensure smoother communication with external services.

Should you have any questions, please get in touch with academy@emagiz.com.

1. Prerequisites

  • Basic knowledge of the eMagiz platform

2. Key concepts

This microlearning centers around handling web service timeouts on SOAP Webservice calls.

  • With SOAP, we mean A messaging protocol specification for exchanging structured information in implementing web services in computer networks.
  • To manipulate the standard timeout on a SOAP web service in eMagiz, you need an HTTP Components message sender (support object)

3. Calling a SOAP Webservice

When talking to external parties via a SOAP web service, you need to define in eMagiz that you want to call a SOAP web service so eMagiz will form a correct SOAP message. In our previous course, we learned how to call a SOAP web service and how you can ensure that detailed faults are returned to the user. In this microlearning, we will build on this knowledge by learning what you can do when confronted with webservice timeouts from an external party.

By default, eMagiz will wait a maximum of 60 seconds to receive a response before throwing a timeout. However, sometimes we see that external parties need more time (for whatever reason) before they can respond to the request we send to the external party. At first, you should discuss alongside the external party whether the response can be delivered quicker to eMagiz to stay within the default timeout of 60 seconds.

In cases where this is not possible, you could use a support object called HTTP Components message sender to influence when eMagiz throws a timeout.

intermediate-soap-webservice-connectivity-handling-webservice-timeouts--http-components-message-sender.png

Once you have dragged it onto the canvas and have provided a correct name, you should configure the component. You can do so on the Advanced tab of the support object.

intermediate-soap-webservice-connectivity-handling-webservice-timeouts--http-components-message-sender-config.png

Here you can manipulate the Connection timeout and the Read timeout to have a different value compared to the default of 60 seconds. Note that the value needs to be entered in milliseconds. So, for example, if the timeout needs to be 120 seconds, you should enter 120000 as a value in both the connection and the read timeout. Once you have done so, you can save the component. Do note that increasing this value to a huge number could mean that other messages need to wait a long time before being processed, as eMagiz will only process one message simultaneously (under default configuration).

Now that we have saved the component, the last step is to link the support object to the web service outbound gateway to ensure that your changed setting will be applied to the web service call. Then, open the web service outbound gateway and select your support object as the message sender.

intermediate-soap-webservice-connectivity-handling-webservice-timeouts--http-components-message-sender-linked.png

4. Key takeaways

  • Use the HTTP Components message sender to customize the default timeout settings for SOAP web service calls.
  • Enter timeout values in milliseconds. For example, a 120-second timeout should be set as 120000 milliseconds.
  • Ensure you connect the HTTP Components message sender to the web service outbound gateway for the settings to take effect.
  • Setting an excessively high timeout could delay the processing of other messages, as eMagiz processes one message at a time by default.

5. Suggested Additional Readings

If you are interested in this topic and want more information, please read the help text provided by eMagiz and check out these links: