|
![]() |
#1 |
Участник
|
Проблема решилась - появилась новая
Получилось вызвать самые простые веб-матоды моего веб-сервиса способом, подсказанным a33ik.
Возникла следующая проблема: веб-методы, в которых не используется доступ к структуре шарапойнт отрабатывает хорошо X++: [WebMethod] public string HelloWorld1(string sitePath, string libName, string folderPath, string fileName, byte[] fileContents) { SPSite site = new SPSite(sitePath); SPWeb web = site.OpenWeb(); return sitePath; } "The HTTP request is unauthorized with client authentication scheme 'Ntlm'. The authentication header received from the server was 'NTLM'." X++: [WebMethod] public string HelloWorld1(string sitePath, string libName, string folderPath, string fileName, byte[] fileContents) { SPSite site = new SPSite(sitePath); SPWeb web = site.OpenWeb(); string libRoot = web.Lists[libName].RootFolder.ServerRelativeUrl.ToString(); return sitePath; } ОС: windows 2003, IIS 6.0 Доступ к вебслужбе осуществляется так: 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.UserName.UserName = @"domen\user"; connector.ClientCredentials.UserName.Password = "****"; connector.ClientCredentials.Windows.AllowedImpersonationLevel = TokenImpersonationLevel.Impersonation; [...] // Тут валится connector.HelloWorld1("http://server:6001", "Библиотека документов", "/Папка1/Папка2/Папка3", "qwe.txt", buffer); Помогите пожалуйста! |
|
![]() |
#2 |
Чайный пьяница
|
У меня к сожалению нет тестового стенда для такой задачи. Попробуйте исправить такие строку (не ругайте меня сильно - не силён я в WCF):
Код: bind.Security.Transport.ClientCredentialType = HttpClientCredentialType.Windows;
__________________
Эмо разработчик, сначала пишу код, потом плачу над его несовершенством. Подписывайтесь на мой блог, twitter и YouTube канал. Пользуйтесь моим Ultimate Workflow Toolkit |
|
![]() |
#3 |
Участник
|
Интеграция CRM и Sharepoint через webservice
Цитата:
Все таки я смог доделать разработку. На всякий случай выкладываю здесь, может кому пригодится через гугл. Сделал ряд мер (толком не понял какое помогло): 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)); } |
|
|
![]() |
||||
Тема | Ответов | |||
Сообщения, на которые регистрируется плагин | 2 | |||
Плагин на обновление | 1 | |||
Плагин для сущности "встреча" | 5 | |||
Тип сущности, использующей плагин | 2 | |||
Как зарегить плагин на смену State? | 8 |
Опции темы | Поиск в этой теме |
Опции просмотра | |
|