I'm trying to retrieve an entity from CRM application using OrganizationServiceProxy. It works on my DEV server which has internet access and it doesn't work on the Test server which does NOT have internet access.
ClientCredentials credential = new ClientCredentials();
credential.UserName.UserName = username;
credential.UserName.Password = password;
Uri uri = new Uri(serviceAddress);
OrganizationServiceProxy proxy = new OrganizationServiceProxy(uri, null, credential, null);
proxy.EnableProxyTypes();
EntityCollection entities = proxy.RetrieveMultiple(new FetchExpression(query));
Error Log on Test server:
System.ArgumentNullException: Value cannot be null.
Parameter name: identityProvider
at Microsoft.Xrm.Sdk.ClientExceptionHelper.ThrowIfNull(Object parameter, String name)
at Microsoft.Xrm.Sdk.Client.ServiceConfiguration`1.AuthenticateOnlineFederationInternal(AuthenticationCredentials authenticationCredentials)
at Microsoft.Xrm.Sdk.Client.ServiceConfiguration`1.Authenticate(AuthenticationCredentials authenticationCredentials)
at Microsoft.Xrm.Sdk.Client.ServiceProxy`1.AuthenticateOnlineFederation()
at Microsoft.Xrm.Sdk.Client.ServiceProxy`1.AuthenticateCore()
at Microsoft.Xrm.Sdk.Client.ServiceProxy`1.ValidateAuthentication()
at Microsoft.Xrm.Sdk.Client.ServiceContextInitializer`1.Initialize(ServiceProxy`1 proxy)
at Microsoft.Xrm.Sdk.Client.OrganizationServiceProxy.RetrieveMultipleCore(QueryBase query)