Цитата:
Сообщение от
a33ik
Код:
bind.Security.Transport.ClientCredentialType = HttpClientCredentialType.Windows;
Нет, это строка не походит. Пишет, что не может подконнектиться под анонимусом. Все равно спасибо за ответ.
Все таки я смог доделать разработку. На всякий случай выкладываю здесь, может кому пригодится через гугл. Сделал ряд мер (толком не понял какое помогло):
1) Выполнил настройку IIS согласно статье
How to configure IIS to support both the Kerberos protocol and the NTLM protocol for network authentication
2) На всякий случай решил эту проблему
You receive error 401.1 when you browse a Web site that uses Integrated Authentication and is hosted on IIS 5.1 or a later version
3) Сам код вызова веб-сервиса выглядит так (извиняюсь за качество, версия рабочая) :
X++:
BasicHttpBinding bind = new BasicHttpBinding(BasicHttpSecurityMode.TransportCredentialOnly);
EndpointAddress endpoint = new EndpointAddress("http://server:6001/_vti_bin/Files.asmx");
bind.Security.Mode = BasicHttpSecurityMode.TransportCredentialOnly;
bind.Security.Transport.ClientCredentialType = HttpClientCredentialType.Ntlm;
bind.SendTimeout = new TimeSpan(0, 1, 0);
bind.ReceiveTimeout = new TimeSpan(0,10,0);
bind.OpenTimeout = new TimeSpan(0, 1, 0);
bind.CloseTimeout = new TimeSpan(0, 1, 0);
bind.MaxBufferPoolSize = 5524288;
bind.MaxBufferSize = 565536;
bind.MaxReceivedMessageSize = 565536;
SharepointConnector.FilesSoapClient connector = new SharepointConnector.FilesSoapClient(bind, endpoint);
connector.ClientCredentials.Windows.ClientCredential.UserName = "user";
connector.ClientCredentials.Windows.ClientCredential.Domain = "domen";
connector.ClientCredentials.Windows.ClientCredential.Password = "****";
connector.ClientCredentials.UserName.UserName = @"domen\user";
connector.ClientCredentials.UserName.Password = "****";
connector.ClientCredentials.Windows.AllowedImpersonationLevel = TokenImpersonationLevel.Impersonation;
connector.ChannelFactory.Credentials.Windows.AllowNtlm = true;
connector.ChannelFactory.Credentials.Windows.AllowedImpersonationLevel = TokenImpersonationLevel.Impersonation;
foreach (annotation note in response.BusinessEntityCollection.BusinessEntities)
{
string attachid = note.annotationid.Value.ToString();
string objecttypecode = "1070"; //SaleLiteratureItem
string a = connector.HelloWorld("wwww");
connector.UploadDocument("http://server:6001", "Библиотека документов", "/Папка1/Папка2/Папка3", note.filename, Convert.FromBase64String(note.documentbody));
}