In all of the following example the user needs from the Messages Tab right click on the specific operation and select Add New Monitor. Then choose a new monitor.
Lets say we have a Web service that we need to know if its up or down. The Web service has a method called StockPrice(String stockTicker). The parameter to this method is a stockTicker and the response is a String which is the stock price for the specific stock ticker.
Here is how you setup a HeartBeat monitor for this web service.
Name - StockPrice active Monitor
Interval - 600
Operation parameter list - MSFT
Threshold - error response time > 400
A different threshold could be. Create another monitor
Threshold - error response value > 25
So if the stock price is over 25 this monitor will be in error.
In this example the user would like to measure the number of faults generated by a Web service operation in a time period. Also if the fault rate increases to a certain number than an alert needs to be fired off.
Name - StockPrice
Threshold - Avg Fault rate > 4
What this threshold means is if 2 faults occur within 1/2 hour which means more than 4 per hour.
Note: This monitor also measures number faults. To see the number of faults over a time period the user needs to create a dynamic report for this monitor by right clicking on the name of the operation this monitor is assigned to.
In this example the user needs to be only notified if a specific string or fault code has been generated by the web service. For example this is the fault that was generated by a Web service operation
<env:Fault><faultcode>env:Client</faultcode><faultstring>JAXRPCTIE01: caught exception while handling request: deserialization error: XML reader error: unexpected character content: "buzz"</faultstring></env:Fault>
The user would like to be notified when "unexpected character content" is in the faultString for a response
Name - Fault Code unexpected character
Fault Element - Fault String
Pattern - .* unexpected character content.*
Threshold - default error if Pattern Match == 'matched'
Note: if there is the pattern is not grouping (captured) any value then the threshold will always be 'matched'.
Lets say in another example the user wants for the pattern to match on 01 in the above string JAXRPCTIE01: and wants to make sure that the value is less than 2 or the monitor will be in error.
Name - Fault Code unexpected character
Fault Element - Fault String
Pattern - .*XRPCTIE0(\d*): caught.*
Threshold - default error if Pattern Match > 2
In this case the value 1 is grouped (captured) by the pattern and the pattern match threshold will be over the number 2.
This monitor is very similar to the fault content monitor. It monitors the content of a message. Lets say the message body contains the following xml text in the request.
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Header/><SOAP-ENV:Body SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><ans1:StockPrice xmlns:ans1="urn:Foo">MSFT</ans1:StockPrice></SOAP-ENV:Body></SOAP-ENV:Envelope>
Lets say the user would like to have the monitor to be in error if the word "MSFT" is in the request. Which means test2 operation is being accessed with the parameter "buzz". Here is what the monitor will look like
Name - MSFT in request
Message Direction - Request
Element Name - test2 param
Element Pattern - .*MSFT.*
Threshold - error if pattern match == 'matched'
Let's say in this example the response from operation test2 is the number 25
<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" env:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:enc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns0="urn:Foo" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><env:Body><ns0StockPriceResponse><result xsi:type="xsd:string">26</result></ns0:StockPriceResponse></env:Body></env:Envelope>
The properties will be
Name - MSFT in request
Message Direction - Request
Element Name - StockPrice param
Element Pattern - .*<ns0StockPriceResponse><result xsi:type.*>(\d*)</result>.*
Threshold - error if pattern match >= 25
This monitor will be in error in this case.