Dynamics 4.0.7 Web Service中缺少程序集

本文关键字:程序集 Service Web Dynamics | 更新日期: 2023-09-27 17:59:02

我为MS Dynamics 4.0.7添加了一个web服务引用。我正在VS 2010中进行开发,我想念微软。CRM。SDK。消息命名空间。消息命名空间之前的所有内容都可以正常工作。

我正在研究一个使用WhoAmIRequest和WhoAmIRCesponse类的基本示例,但由于缺少程序集,我无法进一步了解。

感谢

Dynamics 4.0.7 Web Service中缺少程序集

缺少的命名空间是SDK程序集的一部分。它未包含在web参考中。我假设您引用了MessageName类。

请记住,您可以使用web引用或sdk程序集,但不能同时使用两者,因为在这种情况下会出现类型冲突。

WhoAmIRequest和WhoAmIR响应消息包含在web参考(crmservice)中。

你可以得到这样的当前用户:

    using CrmWebReference; //whatever you called it
    ... 
//crm is the name of my CrmService object
    WhoAmIRequest userRequest = new WhoAmIRequest();
    WhoAmIResponse current = (WhoAmIResponse)crm.Execute(userRequest);
    systemuser currentUser = (systemuser)crm.Retrieve(EntityName.systemuser.ToString(), current.UserId, new AllColumns());