I would like to check the availability and response time of a WSDL or SOAP service. How can I do this with PRTG?
This article applies to PRTG Network Monitor 15.x.19 or later
Testing a WSDL or SOAP Service with PRTG
You can test the availability and response time of a WSDL or SOAP service by utilizing an HTTP Advanced sensor. After all, a SOAP request is at its core just an HTTP POST transaction with a few special options set.
To get it to work you need:
- Service Endpoint/URL
- SOAP Envelope
- SOAP Version
It defines the available operations and layout of the SOAP request.
Using a WSDL tool, you can create the following request:
The specific headers you need are:
Content-Type: text/xml SOAPAction: http://www.webserviceX.NET/GetQuote
The Soap 1.1 Envelope
<s11:Envelope xmlns:s11='http://schemas.xmlsoap.org/soap/envelope/'> <s11:Body> <ns1:GetQuote xmlns:ns1='http://www.webserviceX.NET/'> <ns1:symbol>XXXX</ns1:symbol> </ns1:GetQuote> </s11:Body> </s11:Envelope>
Set up the HTTP Advanced Sensor
To check the availability of your SOAP service with PRTG, these are the steps to follow:
- Add the HTTP Advanced sensor to a device in your device tree.
- Select the following HTTP Specific Settings:
- Request Method: POST
- Postdata: Paste in your SOAP Envelope.
- Content Type: Custom
- Custom Content Type: text/xml if you work with SOAP v1.1 or application/soap+xml if you work with SOAP v1.2. (To get a description of the differences between SOAP 1.1 and SOAP 1.2, you can have a look at this SOAP Web Service Tutorial.)
- Select the following Advanced Sensor Data:
- Use Custom HTTP Headers: Choose the option Use custom HTTP headers
- Custom HTTP Headers: Paste in your SOAP action and the SOAP content type: SOAP Action: [Your SOAP Action] Accept: [Your SOAP Content Type].
Note: It is important that you set the Accept: parameter because otherwise the system inserts Accepts: text/html, which does not give you the result you want. In our example, add the following SOAP Action and Accept parameters to the Custom HTTP Headers field:
SOAPAction: http://www.webserviceX.NET/GetQuote Accept: application/soap+xml
- Result Handling: Store the latest HTML result. This option allows you to see the actual content of the server's response for debug/troubleshooting. Enlarge here.
Look at the Results
To see what is returned as a result, take a look in the sensor log. PRTG usually saves the sensor logs in %PROGRAMDATA%\Paessler\PRTG Network Monitor\Logs (Sensors). The file(s) are called:
- Result of Sensor xxxx: See the whole HTTP transaction.
- Result of Sensor xxxx-A: See the response or answer, which is the raw SOAP return envelope.
This means that the actual return is XML Escape encoded like:
If you want to check the content with a keyword to trigger a warning or error status, you have to use a literal match. In this example, we’re looking for the last price for the stock: <Last> which is XML Escaped as <Last>.
Therefore, take care of the following sensor settings:
- Require Keyword: Set sensor to warning if keyword is missing.
- Response Must Include: [Your Keyword], here: <Last>.
The HTTP Advanced sensor will also give you all the timing information for the SOAP service.