Quantcast
Channel: CRM Development forum
Viewing all articles
Browse latest Browse all 8223

Calling CRM over IFD

$
0
0

Am AD user and same user for CRM also.

but am not able to  esablish connection to my IFD CRM with network crdentilas.

here is the code

ServicePointManager.ServerCertificateValidationCallback = delegate(object s, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors) { return true; };
            Uri organizationUriIFD = new Uri(ServerURL);

ClientCredentials credentials = new ClientCredentials();

credentials.Windows.ClientCredential = (NetworkCredential)CredentialCache.DefaultCredentials;

IServiceConfiguration<IOrganizationService> config = ServiceConfigurationFactory.CreateConfiguration<IOrganizationService>(organizationUriIFD);

 using (Microsoft.Xrm.Sdk.Client.OrganizationServiceProxy _serviceProxy = new OrganizationServiceProxy(config, credentials))
            {
             _serviceProxy.ServiceConfiguration.CurrentServiceEndpoint.Behaviors.Add(new ProxyTypesBehavior());
           IOrganizationService _service = (IOrganizationService)_serviceProxy;
           WhoAmIResponse response = (WhoAmIResponse)_service.Execute(new WhoAmIRequest());
             UserId = response.UserId;
             return _service;
         }

Please help me.....



Viewing all articles
Browse latest Browse all 8223

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>