I'm trying to get the list of organizations from a server using this code:
var clientCredentials = new ClientCredentials();
clientCredentials.Windows.ClientCredential.Domain = "domain";
clientCredentials.Windows.ClientCredential.UserName = "user";
clientCredentials.Windows.ClientCredential.Password = "password";
var discoveryUri = new Uri(String.Format("http://{0}/XRMServices/2011/Discovery.svc", "10.20.30.40"));
var discoveryServiceProxy = new DiscoveryServiceProxy(discoveryUri, null, clientCredentials, null);
discoveryServiceProxy.Authenticate();
var retrieveOrganizationResponse = (RetrieveOrganizationsResponse)discoveryServiceProxy.Execute(new RetrieveOrganizationRequest());
but in the last line throws this error:
organizationName
the Exception type is this:
Please your help with this issue.