2
votes

We will soon upgrade to CRM 2011 so I'm doing some tests. The problem is that when I change my web service reference to the 2011 one, my application stops compiling. It just won't find any entity (example of line that stops working: Account acc = new Account() -> It says that I must miss a reference).

When I compare the web services of the CRM 4 to the one of the CRM 2011, I see that it's true. The CrmService of CRM 4 contains the definition of every entity of the CRM, but they do not appear in the CRM 2011!

Why is that? Am I missing something? Do I need to activate something?

Just to make sure, here are the URLs I'm using:

http://myserver/mscrmservices/2006/CrmServiceWsdl.aspx -> Works perfectly

http://myserver/mscrmservices/2007/CrmService.asmx?WSDL -> Does not contain entity definition

http://myserver/mscrmservices/2007/CrmService.asmx?WSDL&uniquename=MyOrg -> Does not contain entity definition

http://myserver/mscrmservices/2007/crmservicewsdl.aspx -> Does not contain entity definition

2
Did you use a Web Reference, or a Service Reference? Which version of Visual Studio and .NET are you using?John Saunders
Visual Studio 2010 and I use a Web ReferenceMathieu
you should try Service Reference, which is what you should use in general.John Saunders
You're right! But it doesn't correct my issue as my issue is directly in the aspx page.Mathieu
have you tried with Service Reference? It's what generates the classes like Account.John Saunders

2 Answers

7
votes

You are using the wrong endpoints.

Dynamics CRM 2011 introduces a complete new WCF based web service.

It's endpoint is http://ServerName/OrganizationName/XRMServices/2011/Organization.svc See the endpoint overview

So you should either add a Service Reference (See Use the WSDL Endpoint) or use early/late bound access (See Write Code for Microsoft Dynamics CRM (Web Services)

The endpoints you mention in your post are for legacy purposes. See the article Use the Microsoft Dynamics CRM 4.0 (2007) Endpoint

1
votes

I recently came across a similiar situation. We are actually using CRM 4.0 (not 2011), and I was experiencing the same issues you are having. I came across this article:

http://www.stunnware.com/crm2/topic.aspx?id=HelpCustomizations

Basically, a reboot and refresh of the Web Service in VS fixed the issue. It looks like CRM doesn't constantly build these Web Services (which makes sense).