MS CRM 2016: organization service not working
April 6, 2016 2 Comments
I was trying to access on-premise MS CRM 2016 organization service through Visual Studio. But it seems be not working when we use the format like we had before:
http://Name_Of_Crm_Tenant/XRMServices/2011/Organization.svc
I could add this as Service Reference as well as Web service in my visual studio 2013 projects, but it was not giving me the OrganizationService methods.
Searched a lot, and finally found that in order to access the OrganizationService and its methods/ classes, you will need to twist a little bit to the service URL. There is an extra parameter needs to be added to the end of the current format, which is the SDK version:
http://Name_Of_Crm_Tenant/XRMServices/2011/Organization.svc?singleWSDL&sdkversion=8.0
till example:
http://myCrmTenant:5555/XRMServices/2011/Organization.svc?singleWSDL&sdkversion=8.0
And here you go, you have all the methods available as it is. We find a link that says a little about this: https://msdn.microsoft.com/en-us/library/gg309401.aspx
Towards the end of this link, you will read : “Using the WSDL: To add a service reference for these services to a Microsoft Visual Studio project, you must append ?WSDL to the service URL when specifying the address in the Add Service Reference dialog box. For example, the discovery service Web Services Description Language (WSDL) address ishttp[s]://servername/xrmservices/2011/discovery.svc?wsdl.
The web services support SDK versioning. Specifying an SDK version in the WSDL URL indicates a scope for the amount of data to be returned in the WSDL. The syntax for web service SDK versioning ends the URL in ?singleWSDL&sdkversion=X.X. For example, the URL would behttps://mydomain.crm.dynamics.com/xrmservices/2011/discovery.svc?singleWSDL&sdkversion=8.0. In this example, you would have built your application using the Microsoft Dynamics CRM SDK v8.0 assemblies.”
Hope this will save some time for others.
Note: if you want to use MS CRM 2016 XRM dlls, and Visual Studio 2013 for development, and if you face issues while accessing the methods of XRM dlls, check your Visual Studio Framework.
For Visual Studio 2013, you must have “.Net Framework 4.5.2” installed, else you cannot access the XRM dlls. And go for “Microsoft .NET Framework 4.5.2 Developer Pack”.
Rest everything seem to be same as of MS CRM 2011/ 2013. I tried the same crude operations with/ without XRM dlls, and they work pretty much same(same code that I used in other parts of this blog).
regards
joon