/// <summary> /// Demonstrates a basic connection to Discovery.svc using a username and password /// </summary> /// <remarks> /// DiscoveryServiceManager stores endpoint metadata and security token (if necessary). Instance can be reused to /// construct multiple discovery service channels (DiscoveryServiceProxy) /// </remarks> public static void BasicCrmDiscovery() { var serverUri = XrmServiceUriFactory.CreateDiscoveryServiceUri("https://mycrmserver:5555"); var discoManager = new DiscoveryServiceManager(serverUri, "username", "password"); using (var discoProxy = discoManager.GetProxy()) { //Do discovery requests... } }