Retrieving the Web Service Version

banner art

[Applies to: Microsoft Dynamics CRM 4.0]

Find the latest SDK documentation: CRM 2015 SDK

The Web service version is needed to support ISV applications that can easily detect and work with multiple versions of Microsoft Dynamics CRM. The RetrieveVersion message provides support for determining the version, or build number, of the Microsoft Dynamics CRM software installed on the server.

Example

The following code retrieves the version of the server software and produces output like this: "4.0.7283.0"

// Set up the CRM Service.
CrmAuthenticationToken token = new CrmAuthenticationToken();
token.AuthenticationType = 0; 
token.OrganizationName = "AdventureWorksCycle";
 
CrmService service = new CrmService();
service.Url = ""http://<servername>:<port>/mscrmservices/2007/crmservice.asmx";
service.CrmAuthenticationTokenValue = token;
service.Credentials = System.Net.CredentialCache.DefaultCredentials;

RetrieveVersionRequest versionRequest = new RetrieveVersionRequest();
RetrieveVersionResponse versionResponse = (RetrieveVersionResponse)service.Execute(versionRequest);
Console.WriteLine(versionResponse.Version.ToString());

See Also

Other Resources

© 2010 Microsoft Corporation. All rights reserved.