Last Published Ids

Each TBXDS/News or TBXDS/Trade bulk response will contain a list of <LastPublishedId> nodes. These nodes tell the receiver up till which point the data has been returned, so future requests can ask to leave out this duplicate data, reducing the network and server demands. More importantly, this value is the only way to get trade updates, since the maximum number of trade lines returned, is 10,000 and most collections display much activity on an average day.

The <LastPublishedId> mechanism is also triggered by <Quote> requests containing the max-count attribute.

These tags contain an XPath expression and a value, so you can easily update your standard XML Request by using code like

VBScript + MSXML sample

Dim xmlRequest, LastIds
Set xmlRequest = Server.CreateObject("Microsoft.XMLDOM")
' Or: Set xmlRequest = Server.CreateObject("MSXML2.DOMDocument")
Set LastIds = Server.CreateObject("Scripting.Dictionary")

xmlRequest.async = False
xmlRequest.setProperty "SelectionLanguage", "XPath"
xmlRequest.load Server.Mappath("standardrequest.xml")

CollectStoredXPaths LastIds ' Collects <LastPublishedId>s from database

Dim currentNode
For Each dicItem In LastIds.Keys ' Iterate through collection of XPaths
    Set currentNode = xmlRequest.selectSingleNode(dicItem)
    If Not currentNode Is Nothing Then
        ' Set the value of the specified node/attribute
        currentNode.text = LastIds(dicItem)
    End If
Next
Set currentNode = Nothing

' Start exchanging data here.

Note that you need version 2.6 or higher of the MSXML parser for this example to work.