【问题标题】:Unable to add CRM 2011's Organization service as Service Reference to VS project无法将 CRM 2011 的组织服务作为服务参考添加到 VS 项目
【发布时间】:2014-07-16 14:11:57
【问题描述】:

当我尝试在 Visual Studio 中将 Organization Service 添加为 Service Reference 时,我无法访问它。但是,我可以在浏览器中访问服务。我尝试添加OrganizationData 服务,这没有问题。

An Error occurred while attempting to find service at 'http://xxxxxxxx/xxxxx/XRMServices/2011/Organization.svc'.

错误详情

There was an error downloading 'http://xxxxxxxx/xxxxx/XRMServices/2011/Organization.svc/_vti_bin/ListData.svc/$metadata'.
The request failed with HTTP status 400: Bad Request.
Metadata contains a reference that cannot be resolved: 'http://xxxxxxxx/xxxxx/XRMServices/2011/Organization.svc'.
Metadata contains a reference that cannot be resolved: 'http://xxxxxxxx/xxxxx/XRMServices/2011/Organization.svc'.
If the service is defined in the current solution, try building the solution and adding the service reference again.

【问题讨论】:

    标签: visual-studio-2010 wcf dynamics-crm-2011 dynamics-crm service-reference


    【解决方案1】:

    我将引用 SDK 程序集 (Microsoft.Xrm.Sdk.dll, Microsoft.Crm.Sdk.Proxy.dll, Microsoft.Xrm.Client.dll) 与添加服务引用。它们为OrganizationService 提供了非常干净的代理对象,并极大地简化了CrmConnection 类的身份验证。 Here 是一个示例。

    您可以在 MSFT Download CenterNuGet 上找到它们,只要确保您使用的版本与您的 CRM 版本(包括 UR)相匹配。

    【讨论】:

    • 感谢您的回复。我也知道这个选项。但我唯一担心的是为什么我会收到这个错误。通过添加服务,我可以使用 Intelisence 而不是编写字段名称。
    • 通过添加服务引用,您不会在字段上获得智能感知。 MSCRM 不会在 wsdl 中公开实体类型。您仍然可以使用 SDK 引用和CrmSvcUtil 来生成早期绑定类型。
    • 对不起,我忘了提到 CrmSvcUtil。这就是我大部分时间与 Service Ref 一起使用的。无论如何,因为我已经使用 SDK 引用完成了编码。但是要找到我得到的错误的根源,我仍然想保持这个问题的开放性。
    猜你喜欢
    • 2015-08-15
    • 2011-08-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多