Web services Sharepoint 2007 AddList和AddListFromFeature缺少模板列和数据内容
我所做的Web services Sharepoint 2007 AddList和AddListFromFeature缺少模板列和数据内容,web-services,sharepoint,sharepoint-2007,moss,Web Services,Sharepoint,Sharepoint 2007,Moss,我所做的 在SharePoint中,我根据项目任务模板创建了一个列表 我删除了大多数默认列,并添加了新的自定义列 我使用新的格式添加了数据 然后我做了一个“另存为模板”,并选择将模板与内容一起保存 什么在起作用 现在,当我使用该模板在SharePoint内部创建一个新列表时,它可以完美地工作。自定义列已存在,并且数据已按预期预填充 什么不起作用 但是,当我使用SharePoint web services提供的或方法时,会创建新列表,但它只是基于原始项目任务模板,带有默认列和无数据 我尝试过
- 在SharePoint中,我根据项目任务模板创建了一个列表
- 我删除了大多数默认列,并添加了新的自定义列
- 我使用新的格式添加了数据
- 然后我做了一个“另存为模板”,并选择将模板与内容一起保存
- 我尝试按照建议设置自定义模板ID,但这只会阻止我使用该模板(在我执行“创建”时不再列出)
- 我仍在试图弄清楚,这似乎是一个类似的问题,但适用于网站,而不是列表
- 我发现另一个人大约是一年前
<?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>
2测试里程碑发布
测试这个
{00BFEA71-513D-4CA0-96C2-6A47775C0119}
151
响应-由于无法识别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>
已引发类型为“Microsoft.SharePoint.SoapServer.SoapServerException”的soap:ServerException。无法完成此操作。
请重试。0x81072101
我被难住了!所以,如果你能帮忙,我会是一个非常快乐的人!提前谢谢 首先,我想解释为什么不能通过接口创建列表,这两个web服务调用在从自定义模板创建时似乎不包含重要参数,让我们分析查询字符串: 新项目任务(开箱即用) {00bfea71-513d-4ca0-96c2-6a47775c0119}&列表模板=150 自定义新项目任务(保存在列表模板库中) ?CustomTemplate=PT6.stp和FeatureId={00bfea71-513d-4ca0-96c2-6a47775c0119}和ListTemplate=150 自定义新项目任务(manifest.xml编辑为151) ?CustomTemplate=PT6.stp和FeatureId={00bfea71-513d-4ca0-96c2-6a47775c0119}和ListTemplate=151 它们都可以工作,所以我认为Web服务对于自定义模板来说是一个禁忌,或者它有一些秘密的魔力(在列表定义中很常见),因为只指定ListTemplate而不显式自定义即使在UI中也不起作用 如果你不能摆脱这个明显的限制,我的建议是:
我查看了反汇编的代码,但我认为我们不能将其发布到这里,但它只能证明UI是从post(Request.Form)构建的,并查找CustomTemplate参数,而Web服务只有那些方法,因为您无法指定自定义模板。[1]:[2]:[3]:[4]:[5]:为您整理链接。非常好的第一个问题:+1.谢谢Alex!现在我只需要一些答案:)
<% if (bIsCustomTemplate) { %>
<input id="onetidCustomTemplate" type="Hidden" name="CustomTemplate" value=<%SPHttpUtility.AddQuote(SPHttpUtility.HtmlEncode(strCustomTemplate),Response.Output);%> />
<% } %>