0

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)
arkay
  • 3
  • 3
  • Where are you running your application? in your machine? – André Cavaca Apr 10 '19 at 18:12
  • Hi André, I have created a web service which is deployed on both DEV and Test Servers. It's working fine on DEV server but it throws an exception in when I try to run the web service on Test Server. – arkay Apr 11 '19 at 19:11
  • your web service should reach Test server's Dynamics webservices as long as you have Dynamics endpoint mapped in Test server's host file. Can you confirm that? – André Cavaca Apr 11 '19 at 19:16

2 Answers2

0

I had the same issue. The firewall was blocking the some links. After the access to the links were permitted in the server, it worked.

Enigmativity
  • 113,464
  • 11
  • 89
  • 172
Carlos OB
  • 31
  • 3