Choosing between database types
Nov 23 11:35:01
Askari and Java prototyping
Nov 22 4:48:43
Finding scarcity in the digital economy
Nov 10 12:17:27
Tornado - the web services server?
Sep 19 23:19:55
Quote of the week
Jul 18 9:18:44
In response to a question from a reader, Tim, this is a follow-up from an earlier article on SharePoint, SOAP and VBScript. This time, we'll look at how to do more complex calls to SharePoint web services in VBScript
Some web services in SharePoint require passing XML as parameters. Unfortunately, you can't pass an XML document, it has to be an XML node element, and this takes a bit of effort to construct in VBScript.
The example we'll use is making a call to GetListItems, which returns all items in a SharePoint library, optionally matching a query formatted using a special XML syntax.
This VBScript code allows you to query and post just about any information to SharePoint using web services. There are two steps involved:
Option Explicit
Dim xmlDoc, SOAPClient
' Get the root element object
Set SOAPClient = createobject("MSSOAP.SOAPClient") I don't know if this would ever be useful to anyone, but anyway:
Option Explicit
Dim xmlDoc
Set xmlDoc = CreateObject("Microsoft.XMLDOM")
xmlDoc.async = False
xmlDoc.loadXML("<GetList><a><b attr=""5"">a node</b></a></GetList>")
DisplayNode xmlDoc.childNodes
' =================== Helper Routines ==================
Sub DisplayNode(Nodes)
DisplayNode_ Nodes, 0
End Sub
Sub DisplayNode_(Nodes, Indent)
Dim xNode
For Each xNode In Nodes
Select Case xNode.nodeType
Case 1: ' NODE_ELEMENT
If xNode.nodeName <> "#document" Then