Open Documentation Menu

Webservice functions

d.3 webservice functions

Note

Unless otherwise stated, all functions return the string OK by success, else an error message occurs.

Initialization

d3ws_startSession() 

Initialization, returns a session ID (actually without usage)

d3ws_stopSession() 

Completion (optional, applies to new initialization)

Creation of XML (-> XML-Out-Buffer)

d3ws_xml_start()

Beginning of a new XML document, deleting of the previous buffer

d3ws_xml_openNode(name)

Opens a new node, that must be closed with CloseNode again (also “<name>”)

d3ws_xml_addNode(name, value)

Creates a complete node (also “<name>value</name”)

d3ws_xml_closeNode(name)

Closes a node, that was opened with OpenNode

(also "</name>")

d3ws_xml_stop()

Completes the XML-document to be saved now or to be sent

Load, Save, call web-service

d3ws_xml_saveToFile (filename)

Saves the XML-Out-Buffer in the specified file

d3ws_xml_loadFromFile (filename)

Loads the specified file into the XML-In-Buffer

d3ws_http_addParameter (name, value) 

adds a parameter, which is passed at a later call of

sendRequest as POST-Parameter

d3ws_http_setTraceFile (filename)

protocols the following call of sendRequest in a file (useful for troubleshooting)

d3ws_http_sendRequest (url)

Sends the XML-Out-Buffer to the respective URL and loads the result of the request into the XML-In-Buffer.

GET-parameters can be used in the URL.

If previously no further parameter was passed

(addParameter), then the XML will be passed nameless via POST.

Or else the XML will be passed as parameter “xml=” via POST.

XML-Parser (-> XML-In-Buffer)

Navigation

d3ws_xml_setRootNode()

Sets the focal point to the root-node of the XML-document.

d3ws_xml_setParentNode()

Sets the focal point to the parent-node of the previously focussed node.

d3ws_xml_setNode (expression) 

Sets the focal point to any node (relative to the current focussed node).

expression can be:

  • "/" for the root-node

  • “..” for the parent-node

  • "1""n" for the “n”-th child-node

(i.a. count previously with countNodes)

  • “name” for a specific child-node

any combination of the fields above (as path definition, separated with “/”)

d3ws_xml_setNodeByIndex (i)

Analog to setNode(“i”), but an integer can be passed here (setNode expects a string)

Analysis

d3ws_xml_countNodes()

Provides the count of available child-nodes below the currently focussed node.

d3ws_xml_getNodeName (i)

Provides the name of the i-node.

Acces to included values

d3ws_xml_getNodeValue (expression)

Provides the content of the node referred by the expression (relative to the currently focussed node).

Using the expression as in setNode.