Handling Webservice Timeouts

Last modified by Eva Torken on 2023/09/20 14:32

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.

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

  • To manipulate the default timeout, use the HTTP Components message sender
  • Note that the values need to be supplied in milliseconds
  • Don't forget to link the support object to the functional component
  • Don't fill in a crazily high number for the timeout, as that could lead to slower processing of messages

5. Suggested Additional Readings

If you are interested in this topic and want more information, please read the help text provided by eMagiz.