

Publish IT Metrics to Mobile Devices › Configure Web Services Connectors
Configure Web Services Connectors
The following steps show how to configure a Web Services connector to get metric and metadata that returns the response in XML format. The steps for processing JSON responses are similar; use JSONPath expressions to parse responses.
Important! A connector can contain more than one request, however multiple requests should be added to the same connector only if they have an interdependency. If a single request fails to execute, the connector enters a 'Failed' state' will not execute other requests until all requests can execute successfully.
- In the Administrator user interface, go to: Metric Connectors and click Add New, Web Connector.
- In the properties tab, enter information using the following entries as an example for collecting CA stock quotes:
- Name: CA Stock
- Request Name: CA Stock Quote
- Method: GET
- URL: http://finance.xyz.com/webservices/stockquote
- Parameters: Key = stock, Value = CA
- Authentication: None
- In the Response option button, select Status.
- Click the Test button, and verify that the Response status is: HTTP/1.1 200 OK.
- Change the Response option button to: Body, and verify that XML data is displayed.
- To configure metric requests, click the Processing tab, and from the Type drop-down list, select Metric.
- In the Response option button, select Result.
- In the Metric Name field, enter the XPath expression to parse the metric name from the XML body, or constant values using curly brackets {}. The Xpath expressions must result in a NodeSet. Multiple expressions and or constant values must be separate by semicolon (;). For Node-Set-Function syntax, see the W3C XML Path Language (XPath) documentation.
Example of an XPath expression: //field[@[name='name']
Example of a constant value: {CAStock}
Example of multiple expressions and constant values, which results in three metric names selected: //resource[2]/field[@name='name'];{CAStock};//resource[25]/field[@name='name']
- In the Metric Value field, enter the XPath expression to parse the metric value from the XML body. The Xpath expressions must result in a NodeSet. Multiple expressions must be separate by semicolon (;).
Example: //field[@name='price']
- In the Metric Timestamp field, enter the XPath expression to parse the timestamp from the XML body. The Xpath expressions must result in a NodeSet. Multiple expressions must be separate by semicolon (;).
Example: //field[@name='ts']
- Select the Date/Time format. Use the examples in the drop-down list to match the timestamps in the response body.
Note: If you do not specify a Timestamp expression or format, then the polling time is used as the timestamp of the indicator data.
Note: Use Refresh Minutes to specify the frequency for polling data from the web service. This value cannot be updated after Business Indicators are created for a request.
Note: If this request produces variables, they can be configured as an XPath expression to parse the variable value from the XML body, or constant values using curly brackets {}. The Xpath expressions must result in a NodeSet. Multiple expressions and or constant values must be separate by semicolon (;).
- Click the Test button, and verify the processing results.
- To configure metadata requests, click the Processing tab and from the Type drop-down list select Metadata.
- Add one or more variables as an XPath expression to parse the variable value from the XML body, or constant values using curly brackets {}. The Xpath expressions must result in a NodeSet. Multiple expressions and or constant values must be separate by semicolon (;).
- Click the Test button, and verify the processing results.
A single connector can have multiple requests associated with it. Use ‘New’ to create additional requests. Use ‘Clone’ to make a copy of the existing request and make changes as needed. Any changes from ‘New’, ‘Clone’ or ‘Delete’ operations are not final until you click the 'Save" button to save the connector configuration.
- After all requests are created, click Save and view the metrics in the Metrics tab.
Copyright © 2013 CA.
All rights reserved.
 
|
|