Kul*_*ige 7 sharepoint web-services sharepoint-api sharepoint-2010 office365
我想将SharePoint数据用于非.Net平台.为此,我已经使用了像Lists.asmx,Webs.asmx和search.asmx这样的SharePoint OOTB服务.我已使用Authentication.asmx成功添加了对基于表单的身份验证的支持.现在,我想在线提供对Office 365 SharePoint的支持.为此,我有一个我正在研究的SharePoint Online网站演示.问题,我面临的是当我使用Authentication.asmx的Mode方法时,我得到'Forms'作为回应:
<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>
<ModeResponse xmlns="http://schemas.microsoft.com/sharepoint/soap/">
<ModeResult>Forms</ModeResult>
</ModeResponse>
</soap:Body>
</soap:Envelope>
Run Code Online (Sandbox Code Playgroud)
但是,当我使用Login.asmx并传递正确的用户名和密码时,我收到'PasswordNotMatch'错误,相同的凭据在浏览器中正常工作.
<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>
<LoginResponse xmlns="http://schemas.microsoft.com/sharepoint/soap/">
<LoginResult>
<ErrorCode>PasswordNotMatch</ErrorCode>
<TimeoutSeconds>0</TimeoutSeconds>
</LoginResult>
</LoginResponse>
</soap:Body>
</soap:Envelope>
Run Code Online (Sandbox Code Playgroud)
注意: - 这适用于FBA非Office 365 SharePoint站点.
有人可以帮我实现对Office 365 SharePoint Online OOTB服务的支持吗?
我一直在寻找类似的想法,这个线程非常有帮助.他们实际上有一个使用PInvoke的webservice示例,它可能会帮助你实现目标.
编辑:我的搜索引导我到Wictor Wilen的另一篇文章,但现在试图避开ClientOM.
Edit2:好的,让这个工作.使用上面Wictor的代码,我下载了他的示例解决方案并将"MsOnlineClaimsHelper.cs"和"WcfClientContracts.cs"移动到我的项目中,稍后我将摆弄这些文件中真正使用的内容.我只更改了它们以删除ClientOM引用,包括clientContext_ExecutingWebRequest方法.
在示例MVC3应用程序或控制台应用程序中:
MsOnlineClaimsHelper claimsHelper = new MsOnlineClaimsHelper("https://my365site.sharepoint.com/sites/enterprise/", "admin@my365site.onmicrosoft.com", "secret");
using (var lists = new SharePointLists.Lists())
{
lists.Url = @"https://my365site.sharepoint.com/sites/enterprise/_vti_bin/lists.asmx";
lists.CookieContainer = claimsHelper.CookieContainer;
var listCol = lists.GetListCollection();
ViewBag.Message = listCol.InnerXml;
//Console.Write(listCol.InnerXml);
}
Run Code Online (Sandbox Code Playgroud)