By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
428,659 Members | 911 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 428,659 IT Pros & Developers. It's quick & easy.

Anyone can help with adding data to TextML server?

P: n/a
Hello ppl,

Is anyone can help me to figure out how to add data to TextML server
document base?
I have attached snipped, which taking XML source from file and adding it to
documentbase, but my problem is, that i need to add it on "fly", without
touching file system.

Cheers,
arachno

------[Code Snippet] ---------------------

'TEXTML Server Document Types
Const TEXTML_DOCUMENT = 1
Const TEXTML_SYSTEM_DOCUMENT = 2

'TEXTML Server SetDocuments AddFlags
Const TEXTML_ADD_DOCUMENT = 1
Const TEXTML_REPLACE_DOCUMENT = 2
Const TEXTML_INDEX_DOCUMENT = 4

Sub Main
On Error Resume Next
Debug.Clear
Dim ClientSrv
Dim ServerSrv
Dim DocBaseSrv
Dim DocumentSrv
Dim DocList
Dim FileSys
Dim xmlFolder
Dim PersistFile As New PersistFile
Dim Files
Dim Document

'Connect to server
Set ClientSrv = CreateObject("TextmlServer.ClientServices")
Set ServerSrv = ClientSrv.ConnectServer("arachno")

'Connect to Document Base
Set DocBaseSrv = ServerSrv.ConnectDocBase ("demo")

'Get the document services of the Document Base
Set DocumentSrv = DocBaseSrv.DocumentServices

'Create a list object that will contain the list of documents to add
Set DocList = CreateObject("IxiaComponents.DynamicList")

'Process the files in the folder
Set PersistFile = CreateObject("IXIAComponents.PersistFile")
PersistFile.LoadFromFile "C:\garbage\demos\acc.xml"
Debug.Print PersistFile.Content
Set Document = CreateObject("TextmlServer.Document")
Document.AttachContent PersistFile.DetachContent
Document.Name = "acc.xml"
Document.MimeType = "text/xml"
DocList.Add Document
'Set documents
DocumentSrv.SetDocuments DocList, TEXTML_ADD_DOCUMENT +
TEXTML_INDEX_DOCUMENT, TEXTML_DOCUMENT
Debug.Print "Documents added"

ErrHandler:
Debug.Print Err.Description
'...handler here...
End Sub
Jul 20 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.