7

SharePointデータを.Net以外のプラットフォームで使用したい。この目的のために、Lists.asmx、Webs.asmx、search.asmxなどのSharePointOOTBサービスをすでに使用しています。Authentication.asmxを使用したフォームベースの認証のサポートを正常に追加しました。ここで、Office365SharePointOnlineのサポートを提供したいと思います。そのために、私が取り組んでいるSharePointOnlineのデモサイトがあります。問題、私が直面しているのは、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>

ただし、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>

注:-これは、Office365SharePoint以外のFBAサイトに最適です。

誰かがOffice365SharePoint Online OOTBサービスのサポートを実装するのを手伝ってくれませんか?

4

1 に答える 1

6

私は同様のアイデアを検討してきましたが、このスレッドは非常に役に立ちました。彼らは実際にPInvokeを使用したWebサービスサンプルを持っています、それはあなたがそこに着くのを助けるかもしれません。

編集:私の検索は、ウィクター・ウィランによるこの別の投稿に私を導きましたが、今のところClientOMを避けようとしています。

Edit2:了解しました。これが機能しました。上記のWictorのコードを使用して、彼のサンプルソリューションをダウンロードし、「MsOnlineClaimsHelper.cs」と「WcfClientContracts.cs」をプロジェクトに移動しました。後でこれらのファイルから実際に使用されるものをいじります。clientContext_ExecutingWebRequestメソッドを含むClientOM参照を削除するためにそれらを変更しただけです。

サンプル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);
}
于 2011-11-11T14:57:09.383 に答える