UXMon can monitor SOAP services over HTTP/HTTPS by sending SOAP messages. This relies on UXMON scripts of type HTTP.
However, unlike for the web applications, the structure for such a HTTP script cannot be recorded. It has to be manually created.
Below are some guidances to create such a monitoring script.
Pre-requisites
Know the SOAP message to emit and/or be familiar with the structure of WSDL files.
Instructions
1. Create/Open a HTTP Script
Create an empty HTTP script or open an existing one.
Note
2. Insert a new Message
For each SOAP call to monitor, insert a new message.
3. Fill-in the Message Properties
In the Message Properties tab, indicate:
- Message Type = ServerRequest
- Name = <free text>. For instance, the name of the SOAP call.
- URL = <the URL to the SOAP service>
- Command = POST
4. Fill-in the Post File section
Still in the Message Properties, in the Post File sub-tab (on the right-hand side section), indicate the SOAP message payload.
5. Activate the authentication automatic retry
To handle authentication automatically it may be useful to activate automatic retry of the authentication message.
For this purpose, open the script configuration. In section Common / Script Execution switch Executor type to xmlretry
.
6. Save and execute.
Depending on the authentication method, with this first execution, the Editor will request and save the authentication details.
Hints for the SOAP message payload
The SOAP message payload is an XML snippet that uses the SOAP Envelope namespace.
Consider the SOAP web service described by the following WSDL, where you want to monitor operation MyOperation:
<?xml version="1.0" encoding="UTF-8"?> <!-- root element - defines the services --> <wsdl:definitions name="MyOperations" targetNamespace="http://myNamespace.xyz.com" xmlns:tns="http://myNamespace.xyz.com" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"> <!-- definition of the types (parameters) for the request and the response --> <wsdl:types> <xsd:schema targetNamespace="http://myNamespace.xyz.com" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://myNamespace.xyz.com"> <!-- for the response --> <xsd:element name="MyOperation_Response"> <xsd:complexType> <xsd:sequence> <xsd:element name="result" type="xsd:string"/> </xsd:sequence> </xsd:complexType> </xsd:element> <!-- for the request--> <xsd:element name="MyOperation_Request"> <xsd:complexType> <xsd:sequence> <xsd:element name="opParamA" type="xsd:string"/> <xsd:element name="opParamB" type="xsd:string"/> </xsd:sequence> </xsd:complexType> </xsd:element> </xsd:schema> </wsdl:types> <!-- definition of the possible messages (the possible requests and responses) --> <wsdl:message name="MyOperation_Request"> <wsdl:part name="body" element="tns:MyOperation_Request"/> </wsdl:message> <wsdl:message name="MyOperation_Response"> <wsdl:part name="body" element="tns:MyOperation_Response"/> </wsdl:message> <!-- indicates which messages is used for which operation --> <wsdl:portType name="MyOperations"> <wsdl:operation name="MyOperation"> <wsdl:input message="tns:MyOperation_Request"/> <wsdl:output message="tns:MyOperation_Response"/> </wsdl:operation> </wsdl:portType> <!-- indicates which messages/protocols/format to use for which operation --> <wsdl:binding name="MyOperations_Binding" type="tns:MyOperations"> <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" /> <wsdl:operation name="MyOperation"> <soap:operation soapAction="http://myNamespace.xyz.com" /> <wsdl:input> <soap:body use="literal" /> </wsdl:input> <wsdl:output> <soap:body use="literal" /> </wsdl:output> </wsdl:operation> </wsdl:binding> </wsdl:definitions>
The SOAP message payload would be something like:
<?xml version="1.0" encoding="UTF-8"?> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <soap:Body> <myNs:MyOperation_Request xmlns:myNs="http://myNamespace.xyz.com"> <opParamA>abc</opParamA> <opParamB>def</opParamB> </myNs:MyOperation_Request> </soap:Body> </soap:Envelope>
Where:
- Line 2: beginning of the envelop.
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
In green is the soap namespace key (the key name is free). - Line 3: beginning of the body (uses the envelope namespace key)
<soap:Body> - Line 4: operation to execute.
<myNs:myOperation xmlns:myNs="http://namespace.xyz.com">
In orange is the name of the webservice to call (i.e. the target namespace from the WSDL file).
In purple is the key to the webservice namespace key (the key name is free). - Lines 5 and 6: the parameters required by the operation. This is also defined in the WSDL files.