Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Microsoft Dataverse
Answered

Error using OData v4 Data Provider (0x80040224 Failed to connect to OData endpoint)

(0) ShareShare
ReportReport
Posted on by 11

Hello Community,
I followed this link :
https://docs.microsoft.com/en-us/power-apps/maker/data-platform/virtual-entity-walkthrough-using-odata-provider#data-source-details

for define an origin data for connect to my database SQL using a Odata v4 Web Service.
When i try to connect to data i receive the message :
"{"error":{"code":"0x80040224","message":"Failed to connect to OData endpoint."}}"

 

Notes:
1.in this moment the service Odata use the certificate SSL and it use the standard port 443
2.The error message from the trace log is:
"Exception type: System.ServiceModel.FaultException`1[Microsoft.Xrm.Sdk.OrganizationServiceFault]
Message: Failed to connect to OData endpoint.Detail:
<OrganizationServiceFault xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.microsoft.com/xrm/2011/Contracts">
<ActivityId>14fe03fa-d467-4ebe-9545-1b90bb57d117</ActivityId>
<ErrorCode>-2147220956</ErrorCode>
<ErrorDetails xmlns:d2p1="http://schemas.datacontract.org/2004/07/System.Collections.Generic" />
<HelpLink>http://go.microsoft.com/fwlink/?LinkID=398563&amp;error=Microsoft.Crm.CrmException%3a80040224&amp;client=platform</HelpLink>
<Message>Failed to connect to OData endpoint.</Message>
<Timestamp>2022-09-16T19:39:30.2406663Z</Timestamp>
<ExceptionRetriable>false</ExceptionRetriable>
<ExceptionSource>PluginExecution</ExceptionSource>
<InnerFault i:nil="true" />
<OriginalException>PluginExecution</OriginalException>
<TraceText i:nil="true" />
</OrganizationServiceFault>"

 

Thank advance.

 

Categories:
  • Verified answer
    MarcoSi77 Profile Picture
    11 on at
    Re: Error using OData v4 Data Provider (0x80040224 Failed to connect to OData endpoint)

    I Have solved the problem.

     

    After publishing the odata service on standard port 443, we enabled the IIS trace log for the failed request.

     

    From the log file we have retrieved the incoming request:
    "GET /odata/Method?$top=10&$select=LastName,UserMD,Id,FirstName&$count=true "

     

    This request sent by the "Insomnia" client generated the message:
    "A potentially dangerous Request.Path value was detected by the client (&)."

     

    The problem is solved with this code in the "Webapiconfig" file:
    "config.AddODataQueryFilter (new EnableQueryAttribute
    {
    AllowedQueryOptions = AllowedQueryOptions.All,
    Page size = 10,
    MaxNodeCount = 20,
    }); "
    And
    "config.Select (). Expand (). Filter (). OrderBy (). MaxTop (null) .Count ();"

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

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Power Apps - Microsoft Dataverse

#1
stampcoin Profile Picture

stampcoin 17

#2
mmbr1606 Profile Picture

mmbr1606 13 Super User 2025 Season 1

#3
ankit_singhal Profile Picture

ankit_singhal 11 Super User 2025 Season 1

Overall leaderboard

Featured topics