Batch 元素
提供對 HTTP 協議中命令的批處理。Batch 元素必須至少包含一個 Method 元素。Batch 元素允許客戶端應用程序一次性向服務器傳送多個命令。
| ListVersion | 可選屬性,類型為 Integer。指定列表的版本號。 | 
| OnError | 可選。以下是可能的值: 
 | 
| Version | 可選屬性,類型為 String。指定正在服務器上運行的 Windows SharePoint Services 的版本號。版本號包含四個整數,格式為 N.N.N.NNNN,它們表示產品的主版本、次版本、階段版本和增量版本。 | 
| ViewName | 可選屬性,類型為 Guid。指定視圖的 GUID。 | 
示例
下面的代碼示例(如果該示例包含在 HTTP 協議內)將從服務器返回一個名為“Documents”的列表。
<?xml version="1.0" encoding="UTF-8"?>
<ows:Batch Version="6.0.2.5608" OnError="Return">
? <Method ID="0,ExportList">
??? <SetList Scope="Request">Documents</SetList>
??? <SetVar Name="Cmd">ExportList</SetVar>
? </Method> 
</ows:Batch>
用于在 Windows SharePoint Services 中發出多個請求的語法如下所示:
POST /[Path/][Subweb/]_vti_bin/_vti_aut/owssvr.dll?Cmd=DisplayPost<?xml version="1.0" encoding="UTF-8"?>
<ows:Batch OnError="Return">
? <Method ID="String">
??? <SetVar Name="Cmd">Method1_name</SetVar>
??? <SetVar Name="Parameter1">Value1</SetVar>
????? .
????? .
????? .
??? <SetVar Name="ParameterN">ValueN</SetVar>
? </Method>
? <Method ID="String">
??? <SetVar Name="Cmd">Method2_name</SetVar>
??? <SetVar Name="Parameter1">Value1</SetVar>
????? .
????? .
????? .
??? <SetVar Name="ParameterN">ValueN</SetVar>
? </Method>
????? .
????? .
????? .
? <Method ID="String">
??? <SetVar Name="Cmd">MethodN_name</SetVar>
??? <SetVar Name="Parameter1">Value1</SetVar>
????? .
????? .
????? .
??? <SetVar Name="ParameterN">ValueN</SetVar>
? </Method>
</ows:Batch>
在下面的示例中,Batch 元素用于創建名為“Meeting Topics”和“Volunteers”的兩個自定義列表。
POST /STSServer1/_vti_bin/_vti_aut/owssvr.dll?Cmd=DisplayPost<?xml version="1.0" encoding="UTF-8"?>
<ows:Batch OnError="Return">
? <Method ID="0,NewList">
??? <SetVar Name="Cmd">NewList</SetVar>
??? <SetVar Name="ListTemplate">100</SetVar>
??? <SetVar Name="Title">Meeting Topics</SetVar>
? </Method>
? <Method ID="1,NewList">
??? <SetVar Name="Cmd">NewList</SetVar>
??? <SetVar Name="ListTemplate">100</SetVar>
??? <SetVar Name="Title">Volunteers</SetVar>
? </Method>
</ows:Batch>
?
轉載于:https://www.cnblogs.com/zli_lz/archive/2009/07/28/1532692.html
《新程序員》:云原生和全面數字化實踐50位技術專家共同創作,文字、視頻、音頻交互閱讀總結
 
                            
                        - 上一篇: 剑桥少儿英语预备级教案(上) unit1
- 下一篇: 童年记忆-莴苣姑娘的故事
