我想從傳統的ASP頁面訪問sharepoint list webservice。我創建的SOAP XML格式,並試圖調用Web服務的URL,這樣從ASP訪問sharepoint web服務
Dim http ,soap
soap = "<?xml version='1.0' encoding='utf-8'?>"
soap =soap & "<soap12:Envelope xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:soap12='http://www.w3.org/2003/05/soap-envelope'>"
soap =soap & "<soap12:Body>"
soap =soap & "<GetListItems xmlns='http://schemas.microsoft.com/sharepoint/soap/'>"
soap =soap & "<listName>Posts</listName>"
soap =soap & "<viewName></viewName>"
soap =soap & "<query></query>"
soap =soap & "<ViewFields><FieldRef Name='Title' /><FieldRef Name='Modified'/><FieldRef Name='DefaultViewUrl'/><FieldRef Name='ID'/><FieldRef Name='Author'/><FieldRef Name='Name'/><FieldRef Name='Body'/><FieldRef Name='NumComments'/><FieldRef Name='DefaultViewUrl'/></ViewFields>"
soap =soap & "<rowLimit>5</rowLimit>"
soap =soap & "<QueryOptions><IncludeMandatoryColumns>FALSE</IncludeMandatoryColumns><DateInUtc>FALSE</DateInUtc></QueryOptions>"
soap =soap & "</GetListItems>"
soap =soap & "</soap12:Body>"
soap =soap & "</soap12:Envelope>"
Set http = CreateObject("MSXML2.XMLHTTP")
http.Open "POST", URL, False
http.setRequestHeader "Content-Type", "application/soap+xml; charset=utf-8"
http.send(soap)
但我得到的錯誤,如「在服務器上發生錯誤處理URL時,請與系統管理員聯繫。 如果您是系統管理員...「
我需要通過任何身份驗證或其他問題嗎?
什麼網址你張貼到?您不需要共享主機名,但需要共享路徑的其餘部分。 – CBono
這是我正在使用的網址,「Blogs/_vti_bin/Lists.asmx」 – Vishnu
這可能是身份驗證丟失。您無法以匿名用戶的身份訪問SharePoint API。 您可以使用ADO Connector for SharePoint http://www.bendsoft.com/net-sharepoint-connector/。將它與諸如Camelot SharePoint集成服務之類的WCF服務相結合,您將立即開始運行您的ASP Classic集成。 –