如何:从 C# 使用 MS CRM Web 服务?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/819894/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to: Consume MS CRM Web Services from C#?
提问by KM?n
I have to Add, Update and make Inquiry (search) on an entity in MS CRM (Dynamics) Web Service using C#.
我必须使用 C# 在 MS CRM(动态)Web 服务中的实体上添加、更新和进行查询(搜索)。
Now there are two entities Account and Contact in MS CRM both of them can be used for storing customer Information; which entity shall be used for above operation?
现在MS CRM中有两个实体Account和Contact,它们都可以用来存储客户信息;上述操作应使用哪个实体?
I am told that I have to use “CRMService” web service of MS CRM that will provide common methods for Create, Retrieve, Retrieve Multiple, Update, Delete and Fetch for every entity. Is there any web service called crmservice?
有人告诉我,我必须使用 MS CRM 的“CRMService”Web 服务,该服务将为每个实体提供创建、检索、检索多个、更新、删除和提取的通用方法。是否有任何名为 crmservice 的 Web 服务?
Question:
题:
I have developed/deployed several web services, but I have never done anything over MS CRM. I am not sure how to jump-start the development?
我已经开发/部署了几个 Web 服务,但我从未在 MS CRM 上做过任何事情。我不确定如何快速启动开发?
Just thinking, I should create a project, add the web service link in to my VS2005 IDE, and call the web methods? Is that all? Wouldnt I be needing MS CRM SDK? And if yes, then which dlls I would be using? And then again, how to start using it?
只是想,我应该创建一个项目,将 web 服务链接添加到我的 VS2005 IDE 中,并调用 web 方法?这就是全部?我不需要 MS CRM SDK 吗?如果是,那么我将使用哪些 dll?再说一次,如何开始使用它?
Any help/links/pointers/diagrams/articles/etc would be highly appreciated.
任何帮助/链接/指针/图表/文章/等将不胜感激。
Thanks in advance.
提前致谢。
采纳答案by BobbyShaftoe
First, start here:
首先,从这里开始:
http://technet.microsoft.com/en-us/library/aa613627.aspx
http://technet.microsoft.com/en-us/library/aa613627.aspx
Add a reference to this asmx as usual in your VS project:
在你的 VS 项目中像往常一样添加对这个 asmx 的引用:
http:///mscrmservices/2006/crmservice.asmx
http:///mscrmservices/2006/crmservice.asmx
(use whatever is the appropriate URL)
(使用任何合适的 URL)
And use that technet article has a guide to how to use the methods. This should be mostly all you need. If you have any other related questions, just edit and provide them in this question.
并使用该技术网文章提供了如何使用这些方法的指南。这应该是您所需要的大部分内容。如果您有任何其他相关问题,只需在此问题中编辑并提供它们。
回答by friism
Yeah, following up on Bobby's points, you don't need the SDK to use the web service. It contains documentation, some dll's for use when coding plugins and some sample projects (which you could look at).
是的,按照 Bobby 的观点,您不需要 SDK 来使用 Web 服务。它包含文档、一些 dll 用于编码插件和一些示例项目(您可以查看)。
To work with the web service, you may be interested in LinqtoCRM (a project I started): http://codeplex.com/linqtocrm
要使用 Web 服务,您可能对 LinqtoCRM(我开始的一个项目)感兴趣:http://codeplex.com/linqtocrm
Regarding accounts and contacts, usually you model your customer-companies as "accounts" and then create "contacts" attached to those accounts representing the actual people you talk to at those companies.
关于客户和联系人,通常您将客户公司建模为“客户”,然后创建附加到这些客户的“联系人”,代表您在这些公司与之交谈的实际人员。