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 :
Service | Customer Service, Contact Center, Fie...
Answered

OrganizationServiceProxy is null

(0) ShareShare
ReportReport
Posted on by 70

Hi

I am new to WCF implementation.

I have following code which was working fine, but somehow it has stopped working and giving following error:

Unable to Login to Dynamics CRM OrganizationWebProxyClient is null OrganizationServiceProxy is null

Following is the code snippet

private static IOrganizationService GetService(string url, string uname, string pwd)
{

ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;


string servconn = (!string.IsNullOrWhiteSpace(url) && !string.IsNullOrWhiteSpace(uname) && !string.IsNullOrWhiteSpace(pwd)) ? "AuthType=Office365;Username=" + uname + ";Password=" + pwd + ";Url=" + url
: Convert.ToString(ConfigurationManager.ConnectionStrings["CRMConString"].ConnectionString);

CrmServiceClient c = new CrmServiceClient(servconn);

IOrganizationService Service = c.OrganizationWebProxyClient ?? (IOrganizationService)c.OrganizationServiceProxy;
return Service;
}

Kindly help me with this.

I have the same question (0)
  • Verified answer
    Nya Profile Picture
    29,060 on at

    Hi,

    Please refer to the following documentation:

    Use connection strings in XRM tooling to connect to Microsoft Dataverse (Dataverse) - Power Apps | Microsoft Docs

    It states that:

    Office365 AuthType is deprecated and we recommend to use OAuth as the preferred authentication type.

    This section also provides a sample code for using OAuth authentication.

     

    Details about the Deprecation:

    Important changes (deprecations) coming in Power Apps, Power Automate and customer engagement apps - Power Platform | Microsoft Docs

    To allow for transition of customers and partner applications:

    • Effective October 2020, the authentication protocol will be retired for all new tenants.
    • Effective October 2020, the authentication protocol won't be available in all new regions.
    • Effective April 20211, the authentication protocol will be retired for all new environments within a tenant.
    • Effective April 2022, the authentication protocol will be retired for all new and existing environments within a tenant.

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 > Service | Customer Service, Contact Center, Field Service, Guides

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 75 Super User 2025 Season 2

#2
Siv Sagar Profile Picture

Siv Sagar 52 Super User 2025 Season 2

#3
Daniyal Khaleel Profile Picture

Daniyal Khaleel 42 Most Valuable Professional

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans