本文介绍了如何连接到CRM IFD Web服务?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我从SDK中获取了代码,并仅进行了一次修改以设置身份验证类型,但是当我尝试连接时,出现了未经授权错误。
I have taken the code from the SDK and made just one modification to set the authentication type but when I try to connect I get an "Unauthorized" error.
我的代码是:
// Set up the CRM Service.
CrmAuthenticationToken token = new CrmAuthenticationToken();
token.AuthenticationType = 2;
token.OrganizationName = "TESTCRM";
CrmService service = new CrmService();
service.Url = "https://testcrm.ifdtestsystem.com/MSCrmServices/2007/CrmService.asmx";
service.CrmAuthenticationTokenValue = token;
//service.Credentials = System.Net.CredentialCache.DefaultCredentials;
service.Credentials = new NetworkCredential("Bill", "Password");
// Create an account entity and assign data to some attributes.
account newAccount = new account();
newAccount.name = "Greg Bike Store";
newAccount.accountnumber = "123456";
newAccount.address1_postalcode = "98052";
newAccount.address1_city = "Redmond";
// Call the Create method to create an account.
Guid accountId = service.Create(newAccount);
推荐答案
使用SPLA(IFD)时,您还需要填充可以通过查询CrmDiscoveryService来检索票证。
When using SPLA (IFD) you need to also populate the token with a crmticket.The ticket can be retrieved by quering the CrmDiscoveryService.
这篇关于如何连接到CRM IFD Web服务?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!