...
...
...
...
...
Insert excerpt | ||||||||
---|---|---|---|---|---|---|---|---|
|
...
Form: HTTP Collector Details
The form provides the standard form icons
Configure the following fields to set up an HTTP Collector:
...
...
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 :
...
...
...
...
...
...
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
For an HTTP request, define name value pairs to include as part of the HTTP header. (e.g. content-type)
...
Name of the HTTP Collector HTTP Header Item. You must not include a colon after the name. For example, Content-Type is a valid name, whereas Content-Type: is not. For example:
Code Block |
---|
Content-Type |
...
Value of the HTTP Collector HTTP Header Item. For example:
Code Block |
---|
text/xml; charset=UTF-8 |
...
Response
...
...
...
...
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/ |
...
Stream Values in a HTTP Collector
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
Note that the namspace prefix used here 'h' must be configured in the HTTP XML Namspaces form
...
...
...
<root xmlns:h="http://www.w3.org/TR/html4/"> <main page="PF Main Page" > <h:title h:name="PF Title">PF Title Text <h:datarow> <h:data h:initials="AD">Ali Dawson</h:data> <h:data h:initials="GP">Gary Parden</h:data> </h:datarow> </h:title> </main> </root>
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
In a Stream that reads from this collector, any other namespaces defined in the document are used as normal. For example, to write the value from the element Name within each record element to a Stream attribute, you would use the attribute expression in.sf$Name
See Also
...
...
The following example illustrates how a default namespace defined in an XML response is handled.
<?xml version="1.0" encoding="UTF-8"?> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns="urn:xmlns:company-com:message" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:pf="urn:phixflow.message.com"> <soapenv:Body> <queryResponse> <result xsi:type="QueryResult"> <done>true</done> <queryLocator xsi:nil="true"/> <record xsi:type="pf:sObject"> <pf:type>Account</pf:type> <pf:Name>Company1</pf:Name> <pf:CreatedDate>2013-10-31T11:26:21.000Z</pf:CreatedDate> </record> <record xsi:type="pf:sObject"> <pf:type>Account</pf:type> <pf:Name>Company2</pf:Name> <pf:CreatedDate>2013-10-31T11:26:21.000Z</pf:CreatedDate> </record> <size>2</size> </result> </queryResponse> </soapenv:Body> </soapenv:Envelope>
Since this document uses a default namespace ("urn:xmlns:company-com:message"), to refer to any element in an XPath expression that does not explicitly use a namespace you must use the default namespace. So to extract all record elements, you must first define a namespace in the collector for the default namespace. Suppose that you do and give this the name def. Then the XPath (defined in the XPath field on the Response tab) to extract all record elements will be //def:record