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 :
Microsoft Dynamics CRM (Archived)

Azure to CRM 2013 call failures

(0) ShareShare
ReportReport
Posted on by 12

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

I have the same question (0)
  • Bas van de Sande Profile Picture
    4,383 on at

    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

  • Michael G Ferreira Profile Picture
    12 on at

    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?

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 > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans