【问题标题】:SharePoint: 401 Auth error while adding file to SharePoint library from SilverlightSharePoint:从 Silverlight 将文件添加到 SharePoint 库时出现 401 身份验证错误
【发布时间】:2011-12-07 15:24:42
【问题描述】:

我正在尝试从 silverlight 应用程序将 XML 文件添加到 SharePoint 2010 站点中的库。我按照https://sharepoint.stackexchange.com/questions/1837/how-can-i-upload-a-file-to-a-sharepoint-document-library-using-silverlight-and-clhttp://social.msdn.microsoft.com/Forums/en/sharepointdevelopment/thread/f135aaa2-3345-483f-ade4-e4fd597d50d4How can I upload a file to a Sharepoint Document Library using Silverlight and client web-services? 中的步骤进行操作。

但是我收到了一个 Auth 错误。

在对 silverlight 视图 (MVC) 进行一些更改时,数据库中的数据会更新。我在 silverlight Web 应用程序上触发了一项服务 (basicHTTP),以从数据库中获取数据并编写一个 XML 文件。文件写入后,我尝试使用 SharePoint 的 Copy Web 服务将文件上传到 SharePoint 库。

有什么线索吗?

编辑:

我尝试将用于上传文件的代码放在 silverlight 服务器的不同服务中。但是,我不能使用 WSHttp 绑定,因为 Silverlight 不支持它。我正在使用 basicHttp 绑定。如何发送 Windows 用户凭据?

【问题讨论】:

    标签: wcf silverlight-4.0 sharepoint-2010 basichttpbinding


    【解决方案1】:

    我的客户端配置中有这个:

       <bindings>
          <basicHttpBinding>
            <binding name="CustomBinding" maxBufferSize="2147483647"
                maxReceivedMessageSize="2147483647">
              <security mode="TransportCredentialOnly" />
            </binding>
          </basicHttpBinding>
        </bindings>
    

    这会让你更进一步吗?

    【讨论】:

    • 这对我不起作用。这是因为 CopyWS 的客户端本身就是托管在 IIS 上的 WCF 服务。因此,可用的凭据是 ASPNET/网络服务。该用户在 SP 上没有权限。
    • 好吧,但是,如果我错了,请纠正我,使用客户端对象模型上传文件而不是让 Web 服务调用另一个 Web 服务不是更容易吗?
    猜你喜欢
    • 1970-01-01
    • 2011-10-23
    • 1970-01-01
    • 1970-01-01
    • 2023-04-03
    • 1970-01-01
    • 2021-01-18
    • 1970-01-01
    • 2014-12-22
    相关资源
    最近更新 更多