Skip to main content

Notifications

Microsoft Dynamics CRM (Archived)

Issues connecting to Dynamics CRM server using the Visual Studio Dynamics SDK provided by Microsoft.

Posted on by Microsoft Employee

Hi,

I have an issue using ProcessingQuotesAndSalesOrders sample code from CRM SDK https://www.microsoft.com/en-us/download/details.aspx?id=50032

I've created Credentails XML file to connect to my organization 

<?xml version="1.0" encoding="utf-8"?>
<Configurations>
  <Configuration>
    <ServerAddress>crm.dynamics.com</ServerAddress>
    <OrganizationName>OrgName</OrganizationName>    
<DiscoveryUri>disco.crm11.dynamics.com/.../Discovery.svc</DiscoveryUri> <OrganizationUri>org.api.crm11.dynamics.com/.../Organization.svc</OrganizationUri> <HomeRealmUri> </HomeRealmUri> <Credentials> <UserName>username</UserName> </Credentials> <EndpointType>OnlineFederation</EndpointType> <UserPrincipalName> </UserPrincipalName> </Configuration> </Configurations>

where parameters are from my istance of Dynamics 365: > Settings > Customizations > Developer Resources 

Error I received after launching program is:

The application terminated with an error.
Metadata contains a reference that cannot be resolved: 'org.api.crm11.dynamics.com/.../Organization.svc'.
There is an error in XML document (1, 1384).

While accessing "https://org.api.crm11.dynamics.com/XRMServices/2011/Organization.svc?wsdl=wsdl0" in my browser all works fine, I get valid wsdl file.

What might be wrong?

Thanks in advance for your help.

Mariusz

*This post is locked for comments

  • tw0sh3ds Profile Picture
    tw0sh3ds 5,600 on at
    RE: Issues connecting to Dynamics CRM server using the Visual Studio Dynamics SDK provided by Microsoft.

    Well they will work for on-premise deployments, there only will be the issue with Online instances. To be fair with Microsoft, the SDK is for 8.2 version and most likely you have 9.0 on your online (if it's new version of Online). SDK as a package to be downloaded is deprecated for the newest version, all the libraries will be downloaded via nuget and samples will be provided in Developer Guide on Microsoft Docs. Because of that change there was probably a decision made not to update all these since it's going away anyway :)

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Issues connecting to Dynamics CRM server using the Visual Studio Dynamics SDK provided by Microsoft.

    Thanks guys, using XRMTooling solve the issues.

    Question is, why there are outdated samples in newest SDK? :)

    Someone should invest in CMDB

  • Suggested answer
    Aric Levin Profile Picture
    Aric Levin 30,188 on at
    RE: Issues connecting to Dynamics CRM server using the Visual Studio Dynamics SDK provided by Microsoft.

    The ProcessingQuotesAndSalesOrders sample code (also visible in the link below):

    msdn.microsoft.com/.../gg309346.aspx, is using Microsoft.Xrm.Sdk.Client class instead of the Microsoft.Xrm.Tooling.Connector class.

    The Microsoft.Xrm.Sdk.Client class has been deprecated, and although might still work for CRM 2016, I am not sure if still works for Dynamics 365 On-Premise or Online versions.

    Take a look at the sample code in the SDK under XRMTooling folder or Online.

    It seems like the old samples in the SDK have not been updated to use the XRMTooling namespace.

    See the link below Online for additional resources on how to build applications using XRMTooling:

    msdn.microsoft.com/.../dn689057.aspx

    Hope this helps.

  • Verified answer
    tw0sh3ds Profile Picture
    tw0sh3ds 5,600 on at
    RE: Issues connecting to Dynamics CRM server using the Visual Studio Dynamics SDK provided by Microsoft.

    Ok I checked the sample - you will not be able to log in to Online instance of Dynamics365 using this sample, it's very outdated, so in order to run the logic in this sample you will have to prepare your own connection logic (or connect to some on-premise CRM, if you have any). Easiest way to connect to CRM is using Xrm.Tooling assembly which comes also in SDK:

    msdn.microsoft.com/.../jj602970.aspx

    If by any reason you really need to connect to CRM online without using any libraries, there is another sample in SDK that still works correctly:

    "\SDK\SampleCode\CS\GeneralProgramming\Authentication\AuthenticateWithNoHelp"

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Issues connecting to Dynamics CRM server using the Visual Studio Dynamics SDK provided by Microsoft.

    No, if you look closer these links are correct, it's just stupid code formating on that forum that hide them (hover the link and you will see they are correct)

  • tw0sh3ds Profile Picture
    tw0sh3ds 5,600 on at
    RE: Issues connecting to Dynamics CRM server using the Visual Studio Dynamics SDK provided by Microsoft.

    Aren't you missing "http://" in links for your organization that you stored in configuration file?

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!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,149 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans