0
我發現this的問題,但似乎不是我的方式:(HTTP請求不允許客戶端認證方案「NTLM」
我有客戶端服務(控制檯應用程序),並在服務器副作用的Bitrix CMS網站。-service 所以,一切運作良好,但是當我在我的VS 2012和 通話發一天更新服務(...)方法 - 我得到的錯誤:
Received from the server authentication header "NTLM". HTTP request is not allowed for client authentication scheme "Ntlm". Received from the server authentication header "NTLM".
(這是谷歌翻譯)
我嘗試刪除和修復e服務,重新啓動VS,重新啓動Windows,它不起作用。
所以的app.config:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="CTfsTasksWSBinding">
<security mode ="TransportCredentialOnly">
<transport clientCredentialType="Ntlm"/>
</security>
</binding>
</basicHttpBinding>
</bindings>
<client>
<endpoint address="http://server.domen.local/tfs_tasks_ws.php"
binding="basicHttpBinding" bindingConfiguration="CTfsTasksWSBinding"
contract="Bitrix.CTfsTasksWSInterface" name="CTfsTasksWSSoap" />
</client>
</system.serviceModel>
<connectionStrings>
<add name="DefaultConnection" connectionString="Data Source = |SQL/CE|" />
</connectionStrings>
</configuration>
所以,我的代碼:
Bitrix.CTfsTasksWSInterfaceClient cll = new Bitrix.CTfsTasksWSInterfaceClient();
cll.ClientCredentials.Windows.ClientCredential = new System.Net.NetworkCredential(loginn, passwd);
cll.ClientCredentials.Windows.AllowedImpersonationLevel = System.Security.Principal.TokenImpersonationLevel.Delegation;
我創造新的簡單的控制檯應用程序,並粘貼到主APP-一些代碼,我有同樣的錯誤。
請幫我解決這個問題。 謝謝。