The Web service is the core API mechanism for programmatically interacting with all entities in Microsoft Dynamics CRM. This service contains six common methods that work on all entities, and an Execute method that is available for all other needs. The service is strongly typed and WSDL compliant, and it can be updated with any changes to the schema directly through Visual Studio 2008.
…
The CrmService Web service is located at http://<crmserver>/mscrmservices/2007/crmservice.asmx, where <crmserver> is the Microsoft Dynamics CRM Web server.
…
public static CrmService GetCrmService(string orgName, string server) { // Standard CRM Service Setup CrmAuthenticationToken token = new CrmAuthenticationToken(); token.AuthenticationType = 0; //AD (On-premise) token.OrganizationName = orgName; CrmService service = new CrmService(); service.Credentials = System.Net.CredentialCache.DefaultCredentials; // If you know you are using the default credentials, // you can replace the service.Crendentials line with the following line // service.UseDefaultCredentials = true; service.CrmAuthenticationTokenValue = token; service.Url = string.Format("http://{0}/mscrmservices/2007/crmservice.asmx",server); return service; }