web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Error using OData v4 D...
Power Apps
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.

 

ImmaginePower.png
I have the same question (0)
  • Verified answer
    MarcoSi77 Profile Picture
    11 on at

    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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 531 Most Valuable Professional

#2
Haque Profile Picture

Haque 261

#3
Kalathiya Profile Picture

Kalathiya 221 Super User 2026 Season 1

Last 30 days Overall leaderboard