HTTP Client API for ActiveX Version 8.2.2
 —  HTTP Client API for ActiveX  —

Programming the non-XML API

The following sections describe how to use the various operations that the API provides. Any code snippets provided are in Visual Basic. To be able to use the predefined constants and receive tool tips, a reference to the ActiveX control must be added to the Visual Basic project. See sampleVBNonXML for a sample demonstrating the use of the non-XML ActiveX control.

The methods in the non-XML API that have the same name as those in the XML API operate in the same way as their XML counterparts. The only methods documented here are the initialization and data manipulation methods.


Initialization

Before using the API, the ActiveX control must be created and initialized. This is done by using the Initialize method and setting the Tamino XML Server URL.

Example:

...
Dim TamNonXml As TaminoNonXml
...
Set TamNonXml = CreateObject("TaminoNonXml.TaminoNonXmlCtrl1")
If TamNonXml.Initialize = 0 Then
    Call MsgBox("TaminoNonXml initialize failed!", vbExclamation)
    ' exit app
End If

TamNonXml.csDatabaseURL = "http://localhost/tamino/mydb"
...

Top of page

Data Manipulation

Use SetNonXmlWithFilename to insert non-XML documents and GetNonXml to retrieve non-XML documents. The relative URLs used in the methods are combined with the base URL to generate the absolute URL used to specify the document being inserted/retrieved.

The following example inserts a non-XML document:

Example:

...
relURL      = "BIN/BIN/xyz.doc"    ' relative URL of insert document
filename    = "C:\TEMP\xyz.doc"    ' file to read for insert
contentType = "application/msword" ' MIME content type of document to insert

Set doc = TamNonXml.SetNonXmlWithFilename(relUrl, filename, contentType)

If TamNonXml.GetErrorStatus(errtxt) <> 0 Then
    MsgBox("ERROR: " & errtxt)
Else
    MsgBox("OK: " & doc.xml)
End If
...

The following example retrieves a non-XML document:

Example:

...
relURL      = "BIN/BIN/xyz.doc"    ' relative URL of retrieve document
filename    = "C:\TEMP\xyz.doc"    ' file to write for retrieve

Set doc = TamNonXml.GetNonXml(relUrl, filename)

If TamNonXml.GetErrorStatus(errtxt) <> 0 Then
    MsgBox("ERROR: " & errtxt)
Else
    MsgBox("OK: " & doc.xml)
End If
...

Top of page