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

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

OData connection was closed when try to connect to AX UAT server

(1) ShareShare
ReportReport
Posted on by

Hi all,

I have a programme using Odata https request to get data from AX7.

In Dev and Testing environment we found it works perfectly. When I used the same method to request the data from UAT environment, I found the process have an error on a send.

request worked in test:

RequestUri = {https://[test url]/data/ListDatas?$orderby=StartDatetime&$filter=Status eq Microsoft.Dynamics.DataEntities.ListStatus'Pending'}

request fail in UAT:

RequestUri = {https://[uat url]/data/ListDatas?$orderby=StartDatetime&$filter=Status eq Microsoft.Dynamics.DataEntities.ListStatus'Pending'}

Error info:

InnerException = {"The underlying connection was closed: An unexpected error occurred on a send."}

StackTrace = "   at Microsoft.OData.Client.HttpWebRequestMessage.GetResponse()\r\n   at Microsoft.OData.Client.DataServiceContext.GetResponseHelper(ODataRequestMessageWrapper request, IAsyncResult asyncResult, Boolean handleWebException)\r\n   at Microsoft.OData.Client....

Could anyone tell me the potential cause for this error? Is their any difference between the odata request in Test environment and UAT environment?  Thanks!

*This post is locked for comments

I have the same question (0)
  • Verified answer
    somears Profile Picture
    on at
    RE: AX7 Odata connection was closed when try to connect to AX UAT server

    Hi Samuel, we were having the same issue. Updating our solution to the latest .Net framework 4.6 fixed the issue.

  • Suggested answer
    venkatesh vadlamani Profile Picture
    3,180 on at
    RE: OData connection was closed when try to connect to AX UAT server

    I think you are using UAT in HA load balanced topology and other environments are single box VM's

    Had similar issue when our client was going to UAT. Add one line of code to consider all three protocols TLS1 TLS2 TSL3 . The explanation i received from Microsoft escalation engineer is that the Web request encryption is done on the firewall as this acts as Load balancer for the incoming web request. So request should be explicitly marked to use these protocols or else even though u send HTTPS request it doesn't work

    Hope this is helpful

  • Konrad U Profile Picture
    804 on at
    RE: OData connection was closed when try to connect to AX UAT server

    If this is on a separately configured web server the servers are not the same. It might be a difference in the level of .Net installed. In particular the level of TLS might be the issue. Googling the error can help.

  • Community Member Profile Picture
    on at
    RE: OData connection was closed when try to connect to AX UAT server

    Adding this line of code worked for me:

    System.Net.ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Tls12;

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…

Pallavi Phade – Community Spotlight

We are honored to recognize Pallavi Phade as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Tocauer Profile Picture

Martin Tocauer 4

#2
AlissonGodoy Profile Picture

AlissonGodoy 2

#2
Community Member Profile Picture

Community Member 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans