【问题标题】:Sharepoint 2010 and webservices syncSharepoint 2010 和 web 服务同步
【发布时间】:2014-11-25 10:24:13
【问题描述】:

我有一个包含 Web 服务 URL、用户名和密码的列表。我创建了一个自定义选项卡和功能区选项卡。 Web 服务 URL 返回一个大的 xml 文件作为输出。 Now when the list item with the URL is selected and ribbon button is clicked i want to process the XML file and save the data in another list.

我应该使用 Button commandUIhandler 用 Ja​​vascript 编写它还是可以编写为 c# 代码?。

谁能帮帮我。

谢谢。

【问题讨论】:

    标签: javascript c# sharepoint sharepoint-2010 sharepoint-clientobject


    【解决方案1】:

    你有两种方法:

    1. 最简单:用javascript
    2. 最难:使用 webpart 创建自定义 .aspx 页面,然后使用自定义选择事件创建自定义功能区。

    最好的方法是使用 Javascript,因为您使用的是 GUI 操作,而 C# 中对于 ListIten.IsSelected 的列表项没有这样的属性。

    编辑:我发现了一些可以帮助你的东西

    Get selected items from SharePoint 2010 list

    SP.ListOperation.Selection.getSelectedItems() Method

    SharePoint 2010 Get ID of Selected List Item using C#

    当然,谷歌的一点点努力也会有所帮助:

    Google search result

    对于 xml 解析,我建议使用带有 jQ​​uery.parseXML() 的 jquery

    【讨论】:

    • 问题不是选择列表项,而是我如何连接到 Web 服务并处理输出 xml 文件并将其存储在另一个列表中。我不知道用 javascript 处理 xml 文件有多么容易。
    • "Now when the list item with the URL is selected and ribbon button is clicked" for both this actions you need to do what i said.第二步是处理xml。 “webservice URL”所以你在浏览器中调用webservice,你想用浏览器中显示的xml做一些事情?或者你想从服务中调用一些方法?那个 xml 到底是什么?
    • 我在浏览器中调用它们的 web 服务 URL 和输出 xml 将是这样的 10000 TEST KH 01HospitalOrbisstr.5 - 777777 PostalCode> NewyorkD1 我在列表中有相同的字段,我想将每个 xml 元素保存到列表字段。
    猜你喜欢
    • 2012-02-22
    • 2011-10-30
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-04-14
    • 2012-02-07
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多