【问题标题】:How do I connect to a CRM IFD web service?如何连接到 CRM IFD Web 服务?
【发布时间】:2009-04-17 08:20:35
【问题描述】:

我已从 SDK 中获取代码并仅进行了一项修改以设置身份验证类型,但当我尝试连接时,我收到“未经授权”错误。

我的代码是:

// 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);

【问题讨论】:

    标签: web-services dynamics-crm dynamics-crm-4


    【解决方案1】:

    使用 SPLA (IFD) 时,您还需要使用 crmticket 填充令牌。可以通过查询 CrmDiscoveryService 来检索票据。

    【讨论】:

      【解决方案2】:

      This document 包含一个合理的示例,如何使用 CrmDiscoveryService 获取票证并设置 CrmService。

      请注意,将不再需要服务的 Credentials 属性,因为所有身份验证信息都将包含在票证中。

      希望对你有帮助

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2014-01-24
        • 1970-01-01
        • 1970-01-01
        • 2013-09-15
        • 1970-01-01
        • 2010-11-10
        • 1970-01-01
        • 2016-09-24
        相关资源
        最近更新 更多