Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Azure to CRM 2013 call failures

(0) ShareShare
ReportReport
Posted on by 8

Looking for ideas/thoughts on what might be the problem.  

We have an Azure based application that makes calls to our on-premise CRM 2013 solution (IFD configured).   Everything was communicating fine.   We now need to add a web proxy into the mix.   Now the same (working code) is no longer submitting data into CRM (see code / error below).    We are able to login no problems using the browser just the application code is the issue.

ideas?

Exception thrown: 'System.InvalidOperationException' in microsoft.xrm.sdk.dll

 

Additional information: Metadata contains a reference that cannot be resolved: 'fsuat.mydomain.com/.../ls;action=signin&realm=urn:AppProxy:com&appRealm=6b8b0dde-841a-e511-80d1-005056802f76&returnUrl=https:%2F%2FMarketingtst.mydomain.com%2FXRMServices%2F2011%2FOrganization.svc%3Fwsdl&client-request-id=F6D82F48-E4D8-0000-D836-DAF6D8E4D001'.

 

Inner Exception:

 

{"CData elements not valid at top level of an XML document. Line 1, position 3."}

 

Here’s the block o’ code -> it’s borking on the last call

 

            using (DiscoveryServiceProxy discoveryProxy =

                GetProxy<IDiscoveryService, DiscoveryServiceProxy>(serviceManagement, authCredentials))

            {

                // Obtain organization information from the Discovery service.

                if (discoveryProxy != null)

                {

                    // Obtain information about the organizations that the system user belongs to.

                    OrganizationDetailCollection orgs = DiscoverOrganizations(discoveryProxy);

                    // Obtains the Web address (Uri) of the target organization.

                    organizationUri = FindOrganization(_organizationUniqueName,

                        orgs.ToArray()).Endpoints[EndpointType.OrganizationService];

 

                }

            }

            //</snippetAuthenticateWithNoHelp1>

 

 

            if (!String.IsNullOrWhiteSpace(organizationUri))

            {

                //<snippetAuthenticateWithNoHelp3>

                IServiceManagement<IOrganizationService> orgServiceManagement =

                    ServiceConfigurationFactory.CreateManagement<IOrganizationService>(

                    new Uri(organizationUri));

*This post is locked for comments

  • Michael G Ferreira Profile Picture
    8 on at
    RE: Azure to CRM 2013 call failures

    Yes we know it's the web proxy when we remove it all is good in CRM and IFD land.

    More background:

    We also know it only has issues with "1" of our "6" instances.   The rest are fine

    We can successfully connect to this instance via browser login.  Through proxy, through ADFS, CRM etc.    Used fiddler to monitory in and out calls

    However, this is Azure ... not sure how to monitor calls from Azure to our Proxy.   Did ask if we could install fiddler on proxy to see what is incoming?  Vendor said "no".

    It's clear the proxy is blocking a redirection to the organization after authentication.   Wondering where to look now?

  • Bas van de Sande Profile Picture
    4,383 on at
    RE: Azure to CRM 2013 call failures

    Hi Michael,

    The inner exception triggered me:

    {"CData elements not valid at top level of an XML document. Line 1, position 3."}

    You mention that you implemented a web proxy in the mix.  

    It looks like the web proxy is messing up your call. The reason the last call is borked up, is that the origanizationUri is not valid.  

    Can you verify how the data goes in the webproxy and how it comes out of it?

    Is the webproxy a custom thingy?

    I'm looking forward to hear from you. Perhaps I can help :)

    Bas

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,865 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,723 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156 Moderator

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans