An HTTP Collector reads data from a HTTP Datasource. The collector defines how the data needed from the datasource will be extracted to be used in PhixFlow.
Form: HTTP Collector Details
The form provides the standard form icons Insert excerpt _standard_settings _standard_settings nopanel true
Configure the following fields to set up an HTTP Collector:
Field | Description | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Name | Name of the HTTP Collector. | ||||||||||||||||
Enabled | Tick when the configuration is complete and the collector is ready to be used. | ||||||||||||||||
HTTP Data Source | The HTTP datasource that this collector will collect from. | ||||||||||||||||
HTTP Request Method |
| ||||||||||||||||
Icon | The Icon to display in controls when this collector is used. | ||||||||||||||||
Timeout (secs) | The number of seconds to wait for a response from the corresponding HTTP datasource before a timeout is recorded. | ||||||||||||||||
Allow Non-Scheduled Collection | If this is turned on, then the collector will run as part of any ad-hoc Analysis Engine run which requires this data. If not, it will only run as part of a scheduled Task Plan under the Analysis Engine. | ||||||||||||||||
Datasource Instance Expression | The datasource to which this collector is connected may list multiple instances from which the data may be accessed. Each HTTP Datasource Instance is identified by a unique string. This expression should evaluate to a string which allows the collector to determine the specific instance to use. If the expression is blank then the collector will assume that there is only one instance and will use that one by default. If there is more than one instance and no expression is provided here then an error will be thrown during analysis since the collector will be unable to determine which source to use. | ||||||||||||||||
Send Message Define details of the HTTP request sent to the HTTP Datasource to get the data required. | |||||||||||||||||
URL Expression | The URL to be used, without the leading http:// prefix. The URL may contain embedded expressions within { }. If this field is blank, the url field on the httpDatasourceInstance is used directly. For Example, this expression adds to the base url provided by the HTTP Datasource Instance : {_url}/sub1/sub2?param1=3 | ||||||||||||||||
Statement Expression | An expression to generate the data that will be sent by the exporter to the datasource. For Example <?xml version ="1.0"?> <!DOCTYPE CORPORATE DASHBOARD "corpDash.dtd"> <results user="%USERNAME%" password="%PASSWORD%"> <monthlyTotals region={'"' + Region + '"'} division={'"' + Division + '"'}> <totalBilled>{'"' + TotalBilled + '"'}<\totalBilled> <totalCollected>{'"' + TotalCollected + '"'}<\totalCollected> <monthlyTotals> <\results> | ||||||||||||||||
HTTP Headers For an HTTP request, define name value pairs to include as part of the HTTP header. (e.g. content-type) | |||||||||||||||||
Name |
Code Block |
---|
Content-Type |
Value of the HTTP Collector HTTP Header Item. For example:
Code Block |
---|
text/xml; charset=UTF-8 |
The username and password for the HTTP Datasource Instance are available as %USERNAME% and %PASSWORD%.
The data will be encoded using the charset parameter specified by the Content-Type Header if one is present. If no Content-Type Header is set then ISO-8859-1 will be used. If the Content-Type header is set, but does not specify a charset then PhixFlow will use a default character set dependant on the content type.
HTTP Headers
This section has a toolbar with standard buttons. The grid contains a list of the HTTP headers defined for this exporter. To add a HTTP header to the list, clickInsert excerpt | ||||||
---|---|---|---|---|---|---|
|
Insert excerpt | ||||||
---|---|---|---|---|---|---|
|
Response
Define the data response type/format that will be returned:
- HTML: response type allows an XPath Expression to be specified in order to retrieve just specified sections of the data into XML structures.
- XML: response type allows an XPath Expression to be specified in order to retrieve just specified sections of the data into XML structures. XML response types also support XML namespaces. The Xml Namspaces tab will be available when this response type is chosen.
- String: response type will return the full data as a string value.
Please see Response Examples for how the returned data can be used and evaluated in the corresponding stream attribute expressions.
Xml Namespaces
The namespaces defined in an XML response. The names given to these namespaces must match those used in any Xpath expressions used to extract data from an XML response. See examples below.
Name of the XML namespace. By convention, it is recommended that you use the name used in the XML response. E.g. if the XML response contains xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" then make this soapenv.
However, this is not mandatory - you can give any namespace any name - all that matters is that the names defined here match those you use in XPath expressions to extract data from the XML response.
In particular, default namespaces, e.g. xmlns="urn:xmlns:company-com:message" can be given any name, providing that you use this name in XPath expressions.
See HTTP Collectors for examples of using namespaces in XPath expressions to extract data from XML responses.
For example:
Code Block |
---|
soapenv |
Value of the XML namespace. For example:
Code Block |
---|
http://schemas.xmlsoap.org/soap/envelope/ |
...