How to Interpret a Response
By default, the TBXDS engine will send back the data in the UTF-8 encoding. Make sure your XML parser is fully compliant, UTF-8 (the free Microsoft MSXML Parser is one such parser).
Note 1 The UTF-8 encoding uses plain ASCII for ASCII characters between 32 and 126. For other Unicode characters, combinations of bytes with the high bit set are used. Thus for 99% of the quote service, plain ASCII is sent.
Note 2 In an HTTP environment, most parsers will work from memory (in the case of ASP from a unicode stream), rather than disk files, which means that your HTTP client will need to support these encodings, and the XML parser needs to understand in-memory XML, rather than the XML parser having to support multiple encodings. This is true for most implementations.
The structure of the replies is described in detail in TBXDS Responses: the TBMData Structure, but here we'll discuss the structure step by step as you encounter it when processing the XML document.
- <?xml version="1.0"?>
- <TBMData version="3.5">
- </TBMData>
Note 3
Never blindly expect to recieve a certain element except for the containing <TBMData> and the information the TBXDS engine reports within the <MetaData>. Always check the data for the existance of the requested data.
Also, never expect an attribute or element described here to be mentioned in a specific order within the XML tree, nor that they are even used (except for elements and attributes that explicitly state this).
See also Data Stripping: How the TBXDS Engine Compacts Your Data.
Note 4
You should ignore elements and attributes not described here, rather than seeing this as an error. In the future Infront may decide to provide additional data, without breaking the current structure. Because of the extensible XML model used by the TBXDS, no DTDs or XML Schemas are supported.
Also, keep track of the hierarchy, since elements can occur at different nesting levels within the XML data, with different meanings. Therefore you should be very careful with XPath expressions containing
//
for example.