While (RESTful) web services are the predominant design pattern for modern APIs, there remain many APIs that employ the SOAP (Simple Object Access Protocol) protocol. Can the uptime and performance of SOAP APIs be monitored using your API Science account? Most certainly!
In this post, I’ll illustrate how to configure an API Science monitor that checks the status of Flickr’s SOAP API.
Flickr’s API includes a simple request (
flickr.test.echo) that enables you to verify that you have successfully accessed their SOAP API. You wrap a value into a SOAP request and send it to the
echo API endpoint; the Flickr API responds with a SOAP body that returns the value you submitted.
To configure this in your API Science account, create a new monitor, perhaps named “Flickr SOAP API Monitor”:
and we send this using an HTTP POST request, which “submits data to be processed to a specified resource.” Now click “Show settings” to specify the data we’ll submit to the Flickr SOAP API.
A SOAP message is an XML document that can include:
- An Envelope element that identifies the XML document as a SOAP message
- A Header element that contains header information
- A Body element that contains call and response information
- A Fault element containing errors and status information
To query Flickr’s
echo API, we need to create a message that is a SOAP
Envelope element with a
Body child element that includes a
FlickrRequest child element.
To do this, I entered this code into the “Request Body” field in my monitor settings:
<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xmlns:xsd="http://www.w3.org/1999/XMLSchema" > <s:Body> <x:FlickrRequest xmlns:x="urn:flickr"> <method>flickr.test.echo</method> <api_key>my_api_key</api_key> <name>value</name> </x:FlickrRequest> </s:Body> </s:Envelope>
where “my_api_key” is your Flickr API key. Here’s the screenshot:
Save the monitor, then run it. You should see a result similar to:
This illustrates how you can apply your API Science account to monitor SOAP APIs that are critical determinants as to whether your own product will appear up, down, or degraded to your customers.