確保您修改了應用程序的web.config,如下所示。只是簡單地覆蓋在結合節點的安全節點:
<binding name="WssInteropSoap">
<security mode="TransportCredentialOnly">
<transport clientCredentialType="Ntlm" proxyCredentialType="Ntlm"
realm="" />
<message clientCredentialType="UserName" algorithmSuite="Default" />
</security>
</binding>
現在你可以在沒有特殊帳戶(從Windows passtrough)認證或與此代碼,你可以指定一個帳戶:
//credential impersonation (just if you changed your binding settings)
projectSvc.ClientCredentials.Windows.ClientCredential = new NetworkCredential("username", "password", "domain");
projectSvc.ClientCredentials.Windows.AllowedImpersonationLevel = System.Security.Principal.TokenImpersonationLevel.Impersonation;
我希望這將有助於:)
但是,我從來沒有聽說過一個被稱爲功能:「PSIFormsLogin.Login」
也許我用C#建立與PSI的連接的博客條目很有趣:Read Project Server 2010 CustomFields over PSI