View Single Post
  #1 (permalink)  
Old January 13th, 2010, 04:50 AM
ismailc ismailc is offline
Friend of Wrox
 
Join Date: Jan 2007
Posts: 115
Thanks: 2
Thanked 0 Times in 0 Posts
Question VBScript Web Service GetListItem - store returning value

Hi, the code works on my side
I need to get the retunring filed "ows_ID" value
in my vbscript wscript.echo .responseText then i see all the values but no clue on getting the "ows_ID" value

I done the GetListItem method working - but i don't know how to return a value & store in variable
I want to return the value of <FieldRef Name='ows_ID'/> & store in variable

url = "http://.../_vti_bin/Lists.asmx"
list = "Vendor Request"
batch = "<Query><Where><Eq><FieldRef Name='FileLeafRef'/><Value Type='Folder'>AB Test</Value></Eq></Where></Query>"
strviewfields = "<viewFields><FieldRef Name='ows_ID'/></viewFields>"
''soap wrapper plus some info in body
request = "<?xml version='1.0' encoding='utf-8'?>"
request = request + "<soap:Envelope xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'"
request = request + " xmlns:xsd='http://www.w3.org/2001/XMLSchema'"
request = request + " xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/'>"
request = request + " <soap:Body>"
request = request + " <GetListItems xmlns='http://schemas.microsoft.com/sharepoint/soap/'>"
request = request + " <listName>" & list & "</listName>"
request = request + " <query>" & batch & "</query>"
request = request + " <ViewFields>" & strviewfields & "</ViewFields>"
request = request + " </GetListItems>"
request = request + " </soap:Body>"
request = request + "</soap:Envelope>"
'post it up and look at the response
with CreateObject("Microsoft.XMLHTTP")
.open "Get", url, False , null, null
.setRequestHeader "Content-Type", "text/xml; charset=utf-8"
.setRequestHeader "SOAPAction","http://schemas.microsoft.com/sharepoint/soap/GetListItems"
.send request
' wscript.echo .responseText
end with

Please Help
Reply With Quote