web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics 365 | Integration, Dataverse...
Unanswered

IOrganizationService is returning null

(0) ShareShare
ReportReport
Posted on by 5

I am always getting null value from the IOrganizationService i am using version 9 i using securtiy protocol also below is my code 

IOrganizationService service = null;
string contactid = "0";
string crmAddress = ConfigurationManager.AppSettings["ServiceURL"];
string userName = ConfigurationManager.AppSettings["UserName"];
string pwd = ConfigurationManager.AppSettings["Password"];


//M1
//IOrganizationService service;
//ClientCredentials clientCredentials = new ClientCredentials();
//clientCredentials.UserName.UserName = "svc_crm@investmauritius.com";
////clientCredentials.UserName.Password = "CRM@EDB*2018";
//clientCredentials.UserName.Password = "CRM@EDB*2020";
//// For Dynamics 365 Customer Engagement V9.X, set Security Protocol as TLS12
//ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
//// Get the URL from CRM, Navigate to Settings -> Customizations -> Developer Resources
//// Copy and Paste Organization Service Endpoint Address URL
//service = (IOrganizationService)new OrganizationServiceProxy(new Uri(@"">edbmauritius1.crm4.dynamics.com"), null, clientCredentials, null);


//M2
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
var connectionString = @"AuthType = Office365; Url = " + crmAddress + ";Username=" + userName + ";Password=" + pwd;
CrmServiceClient conn = new CrmServiceClient(connectionString);
//IOrganizationService service;
service = (IOrganizationService)conn.OrganizationWebProxyClient != null ? (IOrganizationService)conn.OrganizationWebProxyClient : (IOrganizationService)conn.OrganizationServiceProxy;

I have the same question (0)

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Microsoft Dynamics 365 | Integration, Dataverse, and general topics

#1
Martin Dráb Profile Picture

Martin Dráb 60 Most Valuable Professional

#2
#ManoVerse Profile Picture

#ManoVerse 51

#3
Satyam Prakash Profile Picture

Satyam Prakash 42

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans