我已经完成SharePoint 2007的AddList和AddListFromFeature缺少模板列和数据内容
- 深入了解SharePoint我创建了基于项目的任务模板
- 我删除了大部分默认列一个清单,并添加了新的自定义列
- 我使用新的格式
- 然后添加数据,我做了“另存为模板”,并选择保存模板与内容
什么是工作
现在,当我使用模板来创建新的SharePoint列表里面它完美的作品。自定义列已存在,并且数据全部按预期填充。
什么不工作
然而,当我使用的SharePoint Web服务提供了AddList或AddListFromFeature方法创建新的列表,但它只是基于了与原有项目的任务模板默认列和没有数据!
我已经试过
- 我尝试以下建议in the article from Phase 2设置一个自定义模板ID,但只阻止我使用所有的模板(不再上市的时候我做了“创建”)。
- 我仍然试图找出是否this article applies - 它似乎是一个类似的问题,但适用于网站而不是列表。
- 大约一年前,我发现另一个人是having the same problem。
系统设置
与SharePoint 2007(我想?)工作,使用PHP与的NuSOAP连接。由于我已将项目添加到列表,创建列表和读取数据,因此连接绝对有效。
代码示例
请求 - 对第2阶段的方法模板上面
<?xml version="1.0" encoding="ISO-8859-1"?><SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns2034="http://tempuri.org"><SOAP-ENV:Body>
<AddListFromFeature xmlns="http://schemas.microsoft.com/sharepoint/soap/">
<listName>2Test Milestone Release</listName>
<description>Testing this out</description>
<featureID>{00BFEA71-513D-4CA0-96C2-6A47775C0119}</featureID>
<templateID>151</templateID>
</AddListFromFeature></SOAP-ENV:Body></SOAP-ENV:Envelope>
响应 - 由于失败templateID不被认可
<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><soap:Fault><faultcode>soap:Server</faultcode><faultstring>Exception of type 'Microsoft.SharePoint.SoapServer.SoapServerException' was thrown.</faultstring><detail><errorstring xmlns="http://schemas.microsoft.com/sharepoint/soap/">Cannot complete this action.
Please try again.</errorstring><errorcode xmlns="http://schemas.microsoft.com/sharepoint/soap/">0x81072101</errorcode></detail></soap:Fault></soap:Body></soap:Envelope>
我难倒!所以,如果你能帮助 - 我会是一个非常快乐的人!提前致谢!
[1]:http://msdn.microsoft.com/en-us/library/lists.lists.addlist.aspx [2]:http://msdn.microsoft.com/en-us/library /lists.lists.addlistfromfeature.aspx [3]:http://www.phase2.com/blog/?p = 89 [4]:http://blogs.msdn.com/harsh/archive/2006/08/04/687984.aspx [5]:http://social.technet.microsoft.com/Forums/ zh-CN/sharepointdevelopment/thread/9a8da931-ca44-45be-8d4e-e762adcde238 – Joshua 2009-07-16 18:21:55