Skip to main content

Notifications

Announcements

No record found.

Customer experience | Sales, Customer Insights,...
Suggested answer

Web Service No Longer Able to Connect to Dynamics CRM

Posted on by 70

My client has a custom .NET web service that connects to Dynamics CRM online, but lately the connection to CRM isn't being made, and the web service is encountering a Null Object exception when trying to call a method on the CrmServiceClient object.  Here is the current code to establish the connection to CRM:

public CrmServiceClient getServiceProxy()
{
string connectionString = GetServiceConfiguration();
CrmServiceClient conn = new CrmServiceClient(connectionString);
//return (IOrganizationService)conn.OrganizationWebProxyClient != null ?
// (IOrganizationService)conn.OrganizationWebProxyClient : (IOrganizationService)conn.OrganizationServiceProxy;
return conn;
}

The connection string is: 

<add name="ACISProd" connectionString="AuthType=Office365;Username=********@*****.com; Password=********;Url=https://********.crm.dynamics.com"/>

The CRM is on version :

 1710 (9.2.22041.160) online

Any helpful hints on how to get the connection working again would be greatly appreciated.

  • Suggested answer
    gdas Profile Picture
    gdas 50,085 on at
    RE: Web Service No Longer Able to Connect to Dynamics CRM

    Can you use following authentication type -

    <add name="MyCDSServer"

     connectionString="

     AuthType=ClientSecret;

     url=contosotest.crm.dynamics.com;

     ClientId=AppId;

     ClientSecret=ClientSecret"

     />

    dynamics-chronicles.com/.../step-step-connect-d365-clientsecret-use-apis

  • Suggested answer
    Bipin D365 Profile Picture
    Bipin D365 28,964 Super User 2024 Season 1 on at
    RE: Web Service No Longer Able to Connect to Dynamics CRM

    Hi,

    You will have to update your code to use Oauth instead of using Office365.

    xrmdynamicscrm.wordpress.com/.../

  • edmunch Profile Picture
    edmunch on at
    RE: Web Service No Longer Able to Connect to Dynamics CRM

    I do not believe you can use Office365 for AuthType any longer.  Have you looked at this article?

    https://docs.microsoft.com/en-us/power-apps/developer/data-platform/authenticate-office365-deprecation

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans