2016-04-07 13 views
0

Webサービス経由でSharePoint 2013から特定のリストアイテムを取得するはずのVBスクリプトがあります。SharePoint - SOAP要求をWebサービスに返す操作の一覧

関連するコード:

Dim response, request, colItem, objItem 
Dim fileSystem: Set fileSystem = CreateObject("Scripting.FileSystemObject") 
request = "<?xml version='1.0' encoding='utf-8'?>" & _ 
"<soap:Envelope xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/'>" & _ 
" <soap:Body>" & _ 
" <GetListItems xmlns='http://schemas.microsoft.com/sharepoint/soap/'>" & _ 
"  <listName>{FC3E18D6-33E5-4032-BE4B-F0F92F6F18BA}</listName>" + _ 
"  <viewName>{2861DF9F-11F8-4E4B-A318-D4D37C1C5169}</viewName>" + _ 
"  <query></query>" & _ 
" </GetListItems>" & _ 
" </soap:Body>" & _ 
"</soap:Envelope>" 

http.open "POST", "http://<redacted>/_vti_bin/Lists.asmx", False 
http.setRequestHeader "Content-Type", "text/xml; charset=utf-8" 
http.setRequestHeader "Content-Length", Len(request) 
http.setRequestHeader "SOAPAction", "http://schemas.microsoft.com/sharepoint/soap/GetListItems" 
http.send request 

しかし、それはちょうど私が直接サポートされている操作のリストです.../_ vti_bin/Lists.asmxにナビゲートする場合、私は見る同じページを返しています。

POST /_vti_bin/Lists.asmx HTTP/1.1 
Host: <redacted> 
Content-Type: text/xml; charset=utf-8 
Content-Length: length 
SOAPAction: "http://schemas.microsoft.com/sharepoint/soap/GetListItems" 

<?xml version="1.0" encoding="utf-8"?> 
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> 
    <soap:Body> 
    <GetListItems xmlns="http://schemas.microsoft.com/sharepoint/soap/"> 
     <listName>string</listName> 
     <viewName>string</viewName> 
     <query>string</query> 
     <viewFields>string</viewFields> 
     <rowLimit>string</rowLimit> 
     <queryOptions>string</queryOptions> 
     <webID>string</webID> 
    </GetListItems> 
    </soap:Body> 
</soap:Envelope> 

私の周りGoogleで検索して見つけることができなかった:私は「GetListItems」をクリックすると、サンプルXMLは、それは私がオプションであると考えているいくつかのパラメータを除いて、私はVBスクリプトで持っているもののようなルックスを提供します私が間違ってやっていること。代わりに、GUIDの

おかげ

答えて

0

は、リスト名とたviewName XML要素のための定期的なリストの名前とビューを使用してみてください。

<GetListItems xmlns="http://schemas.microsoft.com/sharepoint/soap/"> 
    <listName>My List</listName> 
    <viewName>All Items</viewName> 
</GetListItems> 

ここでは、jQueryを使用してSP 2013サイトで使用したサンプルコードを示します。

$.ajax({ 
    type: "POST", 
    contentType: "text/xml; charset=utf-8", 
    url: "https://site/_vti_bin/Lists.asmx", 
    data: '<?xml version="1.0" encoding="utf-8"?> <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> <GetListItems xmlns="http://schemas.microsoft.com/sharepoint/soap/"> <listName>My Test Cases</listName> </GetListItems> </soap:Body> </soap:Envelope>', 
    dataType: "xml", 
    success: function (msg) { 
    console.log(msg); 
    }, 
    error: function (data, status, error) { 
    console.log('error'); 
    } 
    }); 
関連する問題