How to monitor a SOAP service
This is a complete end to end-user guide on how to call, and evaluate a response from an XML based SOAP service using a Temperature Converter from W3Schools
The Nodinite Web Service Monitoring Agent can perform a request and then evaluate the body from the HTTP response. Each Web Service configuration will eventually end up as a Resource in one or more Monitor Views where the currently evaluated state is presented.
Step 1: Add a new Application
Enter the name and a unique id per application.
Repeat as needed. The Nodinite Application features facilitates grouping and identififcation:
Step 2: Add the SOAP Service to be monitored
Step 3: Basic tab
Next, you will name the configuration by editing the following fields from within the Basic tab:
- Make sure the configuration is enabled (checked)
- Set the Display name to some logically good name, for example:
Evaluate Temperature using a SOAP service
- Set the Description and provide some basic information that makes it easy for someone else to understand the purpose of your configuration, for example,
Sample SOAP Service
- Select the Application you created in Step 1
Step 4: Advanced tab
Next, you will manage your time related thresholds, editing the following fields from within the Advanced tab:
- Set the Polling Interval to some value, for example, 3600 (This type of check does not need to be performed very often)
- Set the Request Timeout to some value, for example, 120.
- Check the Allow Retries checkbox
- Set the Number of retires to some value, for example, 3. A single missed call should not give you an alert for this type of check
- Set the Retry Status Code to OK, meaning that we ignore any errors during the retry period
Step 5: Request tab
Next, you will manage items related to the actual Request. This information is managed from within the Request tab:
- Enter the URI to the Web API, for example,
https://www.w3schools.com/xml/tempconvert.asmx
- The method to use is usually POST
- Check the SOAP checkbox
- Enter the XML body to use as payload calling the SOAP service, for example
<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
<soap12:Body>
<CelsiusToFahrenheit xmlns="https://www.w3schools.com/xml/">
<Celsius>42</Celsius>
</CelsiusToFahrenheit>
</soap12:Body>
</soap12:Envelope>
- Set the Content-Type to
application/soap+xml; charset=utf-8
If you omit the Content-Type HTTP header, the following error is usually the result:
Expect the following evaluated error state when the Content-Type is missing/invalid
You will need to find out what is the proper Content-Type to use for your actual case
Step 6: Response tab
Next, you will manage some technical details about the response. This information is managed from within the Response tab:
- Set the Status Code to
200
which means OK
You should normally not need to add configuration on the performance for this type of check. Leave the checkboxes unchecked.
Step 7: Evaluate response body tab
Next, you will configure the evaluation of the HTTP response body part. This configuration is performed from within the Evaluate response body tab:
- Select the Expression Type
Xpath
- Enter the following Expression:
/*[local-name()='Envelope']/*[local-name()='Body']/*[local-name()='CelsiusToFahrenheitResponse']/*[local-name()='CelsiusToFahrenheitResult']
The XPath must use local-name() when the response has a namespace
- The expected result is 107.6, Use any other value to perform a negative test
XML SOAP Response
For reference, the XML for the SOAP response is provided below:
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
<soap12:Body>
<CelsiusToFahrenheitResponse xmlns="https://www.w3schools.com/xml/">
<CelsiusToFahrenheitResult>107.6</CelsiusToFahrenheitResult>
</CelsiusToFahrenheitResponse>
</soap12:Body>
</soap12:Envelope>
Step 8: Certificate tab
You may want to ensure that there are no problems with the certificates if your SOAP service is configured to use HTTPS.
You can configure Nodinite to give you an alert if there is a problem detected with the certificate used for HTTPS. The configuration for this evaluation is managed from within the Certificate tab:
- If you use a certificate, then check the Evaluate certificate checkbox, otherwise leave it unchecked
- Set the number of days before the certificate expires to get a Warning alert
- Set the number of days before the certificate expires to get an Error alert
- If you have a certificate, then you might want to enforce that it is always being used. Check Force the use of certificate checkbox if this is the case
- The main purpose of this check is to evaluate the SOAP service, leave the Allow connection for invalid certificates checkbox unchecked
Step 9: Authentication tab
In this example, there is no need to provide any authentication details since the service is not protected or authenticated in any way.
Step 10: Save configuration
Next, you must Save the configuration. Click the Save button and then you should see a message that the operation succeeded:
Step 11: Create a Monitor View and Configure alerts
Next, you should configure a Monitor View and select an appropriate Alarm Plugin to get the alert in the way you prefer. These steps are documented in the Add or manage Monitor View user guide.
Next Step
Related
Add or manage a Monitoring Agent Configuration
Monitoring Agents
Administration
Monitoring Agents