Hi all,
After having considerable success with SOAP calls to SharePoint, I'm now stumped on GetListItems. This code appears correct to me and the SOAP request header was borrowed from code that is working so my assumption, whether correct or not, is that there is something wrong with the format of the specific GetListItems request because I consistently get a BAD REQUEST HTTP response. I've included all the tags for all elements, but my understanding from the confusing SP WSS 3 documentation is that pretty much everything except listName and an empty queryOption tag is optional. So I'm stumped. Any ideas?
sURL = "https://in2.nokia.com/sites/" & SiteURL & "/_vti_bin/Lists.asmx?op=GetListItems"
sEnv = "<!--?xml version=" & Chr(34) & "1.0" & Chr(34) & " encoding=" & Chr(34) & "UTF-8" & Chr(34) & "?-->"
sEnv = sEnv & "<soap:envelope xmlns:xsi=" & Chr(34) & " http:="" www.w3.org="" 2001="" xmlschema-instance"="" &="" chr(34)="" "="" xmlns:xsd=" & Chr(34) & " xmlschema"="" xmlns:soap=" & Chr(34) & " schemas.xmlsoap.org="" soap="" envelope="">"
sEnv = sEnv & "<soap:body>"
sEnv = sEnv & "<getlistitems xmlns=" & Chr(34) & " http:="" schemas.microsoft.com="" sharepoint="" soap="" "="" &="" chr(34)="">"
sEnv = sEnv & "<listname>{600FD7EF-4AE4-4B49-A4BF-49AAB0D7C739}</listname>"
sEnv = sEnv & "<viewname></viewname>"
sEnv = sEnv & "<query></query>"
sEnv = sEnv & "<viewfields></viewfields>"
sEnv = sEnv & "<rowlimit></rowlimit>"
sEnv = sEnv & "<queryoptions></queryoptions>"
sEnv = sEnv & "<webid></webid>"
sEnv = sEnv & "</getlistitems>"
sEnv = sEnv & "</soap:body>"
sEnv = sEnv & "</soap:envelope>"
With xmlhtp
.Open "POST", sURL, False
.setRequestHeader "Host", ""
.setRequestHeader "Content-Type", "text/xml; charset=utf-8"
.setRequestHeader "Content-Length", "255"
.setRequestHeader "soapAction", "http://schemas.microsoft.com/sharepoint/soap/GetListItems"
.send sEnv
After having considerable success with SOAP calls to SharePoint, I'm now stumped on GetListItems. This code appears correct to me and the SOAP request header was borrowed from code that is working so my assumption, whether correct or not, is that there is something wrong with the format of the specific GetListItems request because I consistently get a BAD REQUEST HTTP response. I've included all the tags for all elements, but my understanding from the confusing SP WSS 3 documentation is that pretty much everything except listName and an empty queryOption tag is optional. So I'm stumped. Any ideas?
sURL = "https://in2.nokia.com/sites/" & SiteURL & "/_vti_bin/Lists.asmx?op=GetListItems"
sEnv = "<!--?xml version=" & Chr(34) & "1.0" & Chr(34) & " encoding=" & Chr(34) & "UTF-8" & Chr(34) & "?-->"
sEnv = sEnv & "<soap:envelope xmlns:xsi=" & Chr(34) & " http:="" www.w3.org="" 2001="" xmlschema-instance"="" &="" chr(34)="" "="" xmlns:xsd=" & Chr(34) & " xmlschema"="" xmlns:soap=" & Chr(34) & " schemas.xmlsoap.org="" soap="" envelope="">"
sEnv = sEnv & "<soap:body>"
sEnv = sEnv & "<getlistitems xmlns=" & Chr(34) & " http:="" schemas.microsoft.com="" sharepoint="" soap="" "="" &="" chr(34)="">"
sEnv = sEnv & "<listname>{600FD7EF-4AE4-4B49-A4BF-49AAB0D7C739}</listname>"
sEnv = sEnv & "<viewname></viewname>"
sEnv = sEnv & "<query></query>"
sEnv = sEnv & "<viewfields></viewfields>"
sEnv = sEnv & "<rowlimit></rowlimit>"
sEnv = sEnv & "<queryoptions></queryoptions>"
sEnv = sEnv & "<webid></webid>"
sEnv = sEnv & "</getlistitems>"
sEnv = sEnv & "</soap:body>"
sEnv = sEnv & "</soap:envelope>"
With xmlhtp
.Open "POST", sURL, False
.setRequestHeader "Host", ""
.setRequestHeader "Content-Type", "text/xml; charset=utf-8"
.setRequestHeader "Content-Length", "255"
.setRequestHeader "soapAction", "http://schemas.microsoft.com/sharepoint/soap/GetListItems"
.send sEnv
Last edited: