Skip to main content
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;

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

News and Announcements

Now Available: 2025 Release Wave 2

Quick Links

Ramesh Kumar – Community Spotlight

We are honored to recognize Ramesh Kumar as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

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

#1
Adis Profile Picture

Adis 136 Super User 2025 Season 1

#2
Sohail Ahmed Profile Picture

Sohail Ahmed 81

#3
Jonas "Jones" Melgaard Profile Picture

Jonas "Jones" Melgaard 77 Super User 2025 Season 1

Product updates

Dynamics 365 release plans