You can define a data source to receive data from an HTTP server (for
example, using the SOAP protocol). The data source sends an HTTP request to an URL and parses the
response (in XML, HTML, or JSON formats) into the attributes of the resulting data set. You can
select the data that is retrieved from the request.
About this task
By using the SOAP data source, you can specify an HTTP URL and send a GET, POST,
or PUT request. For POST or PUT requests, you can specify the associated POST data. An XML, HTML, or
JSON response is retrieved and parsed, and the data is exposed to the monitoring environment in
attributes. You can define the attributes as all of the values within a particular element. Or you
can define custom XPath values to specify how to populate individual attributes.
You can also combine the two mechanisms.
Use the following procedure to collect and parse XML, HTML, or JSON responses from a URL:
Procedure
On the Agent Initial Data Source page
or the Data Source Location page, click Data
from a server in the Monitoring Data Categories area.
Note: You
can use a configuration variable or multiple configuration variables
that resolve to a URL. Click Insert Configuration Property to
select a property to insert. For more information, see Customizing agent configuration.
Select a request type. The default request type is Get.
For Post and Put requests, enter the data to be processed.
Note: For
Post and Put requests, the Insert Configuration Property is
enabled. Click Insert Configuration Property to
include a configuration variable in the data to be processed. For
more information, see (Customizing agent configuration).
Click Browse
Note: If after you enter a URL and select a request type, you
do not want to use the SOAP browser to build the definition, enter
a Row Selection XPath. You enter the Row
Selection XPath in the SOAP Information window.
Next, define all of the attributes for the attribute group.
In the SOAP Browser window, do the
following steps:
Enter a URL and select a request type if you did not
already do so.
Click Configuration to set any
configuration properties that are referenced in the URL or other fields.
Click Connect to obtain data
from the SOAP provider.
When you connect to the URL, a list of XML elements for this URL is shown in a
Document Object Model (DOM) tree. An HTML or JSON response is converted to XML and displayed as a
DOM tree. For details about conversion of a JSON response to XML, see XML representation of JSON data. In the WebSphere® Application Server example in (Figure 1), the
following URL was entered:
The
PerformanceMonitor XML element is shown. This element is the top-level XML element
in the XML document that is returned by the SOAP provider.
Figure 1. SOAP Browser window
In the DOM tree, find and select the XML node that you
want to set as the Row Selection XPath.
In the WebSphere Application
Server example in (Figure 2),
the PerformanceMonitor/Node/Server/Stat/Stat/Stat node
is selected. This node represents a row of data in the attribute group.
When you select a node in the DOM tree and click Add,
you get all of the attributes and elements defined on that node of
the tree. (You click Add in the Agent
Attributes area).
When a node is selected, the XML
Attributes area shows any XML attributes defined for the
selected node. Select an XML attribute and click Add to
include this attribute in the list of Agent Attributes.
Note: If
more than one row of data is expected, the XPath must map to a node
set. Where the Row Selection XPath returns a node that is set with
only one item, the attribute group contains only one row.
Figure 2. SOAP Browser window
Click Add in the
Agent Attributes area.
The list of agent attributes is
shown and the Row Selection XPath field is
filled.
The XPath for each agent attribute is used to map XML
nodes or elements to agent attributes. In the WebSphere Application Server example in
theFigure 3, the first
attribute in the list of agent attributes, Stat,
is not of use and would be removed.
You can edit the name and
XPath for an agent attribute in the Type Value field.
For more information about using XPaths, see XPath options
Figure 3. SOAP
Browser window
In the SOAP Browser window, click OK to
save your changes and return to the SOAP Information window.
In the SOAP Information window, click Next.
If you did not use Browse earlier
and you entered the URL and Row
Selection XPath in the SOAP Information window,
the Attribute Information page is shown. Specify
the information for the first attribute on the Attribute
Information page, and click Finish.
You can then specify more attributes by using the Agent Editor. For
more information about creating attributes, see (Creating attributes).
If you used the Browse function
in step 6, the Select
key attributes page is shown. On the Select key
attributes page, select key attributes or indicate that
this data source produces only one data row. For more information,
see Selecting key attributes.
Optional: You can test this attribute group
by clicking Test. For more information about
testing, see Testing SOAP attribute groups
Optional: You can create a filter to limit
the data that is returned by this attribute group by clicking Advanced.
For more information about filtering data from an attribute group,
see Filtering attribute groups
Do one of the following steps:
If you are using the Agent wizard,
click Next.
Click Finish to save the data
source and open the Agent Editor.