Тема: Новый Task
Показать сообщение отдельно
Старый 02.06.2009, 18:15   #6  
Kipetcoff is offline
Kipetcoff
Участник
 
136 / 16 (1) ++
Регистрация: 20.05.2009
Адрес: Санкт-Петербург
Заработало..я поменял код создания сервиса

Код:
CrmAuthenticationToken token = new CrmAuthenticationToken();
			token.OrganizationName = sOrgname;
			token.AuthenticationType = 0;

			//Create the Service 
			CrmService crmService = new CrmService();
			//crmService.Credentials = System.Net.CredentialCache.DefaultCredentials;
			crmService.Credentials = new System.Net.NetworkCredential("administrator", "pass@word1");
			crmService.PreAuthenticate = false;
			crmService.CrmAuthenticationTokenValue = token;
			string crmurl = (string)(Registry.LocalMachine.OpenSubKey("Software\\Microsoft\\MSCRM").GetValue("ServerUrl")) + "/2007/crmservice.asmx";
			crmService.Url = crmurl;