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 AX (Archived)

WCF and C# - Socket timeout error

(0) ShareShare
ReportReport
Posted on by 2,894

Hi, I have an application created in C# that connects to AX through WCF, everything works fine, but there's an specific code where I always get this error:

It's basically a method that fills a List with data and retrieve it, I've done it before with no issues, but this is happening just now. I added these to the web.config in the binding related to that code:

        <binding name="NetTcpBinding_Service1" 
                 maxReceivedMessageSize="2147483647" 
                 maxBufferSize="2147483647" 
                 maxBufferPoolSize="2147483647"
                 closeTimeout="00:30:00"
                 openTimeout="00:30:00" 
                 receiveTimeout="00:30:00" 
                 sendTimeout="00:30:00" />


With no luck, I've been searching on the web and most people say to apply the same config on app.config, however I can't find that file in my project, and I try to add a new item, an "Application configuration file" is not listed so I can't add it. 

I read that you can edit also Ax32Serv.exe.config but I don't know if this is where I need to add my binding settings (like the ones I posted above) because I tried and it did not work. I'm running out of ideas so I would appreciate your help, this is AX 2012 R2.

Thanks!

*This post is locked for comments

I have the same question (0)
  • Martin Dráb Profile Picture
    237,801 Most Valuable Professional on at

    Does it really fail after one minutes (due to the timeout) or earlier (due to an error; i.e. the problem is not in the timeout). Is there any inner exception? Also, when configuring timeouts, don't forget that it may in both the service and the service client and WCF contains quite a few different timeouts.

    Web application use web.config instead of app.config.

  • saman0suke Profile Picture
    2,894 on at

    It takes like 5 seconds to get the error, and this is the only exception that I get:

    I'm not a big expert on configuring timeouts, I just set the timeouts on the web.config file in the project, in which other file or place should I check for those timeouts?

    The method that throws the error loops over a table in AX and fills a List array with data, would it be that too many records are being retrieved and the data received is too heavy? thanks for the help!

  • Martin Dráb Profile Picture
    237,801 Most Valuable Professional on at

    If it takes five seconds, it doesn't seem related to your 30 or 60 seconds timeout, therefore I expected it's the other case: an exception. But I don't dare to guess which exception it can be, because it really can be anything. You'll have to find more information. View Details... highlighted in your screenshot would be a good first step.

  • saman0suke Profile Picture
    2,894 on at

    The exact same code works in another installation of AX, I checked on the table that is used and the one that works contain less rows but that should not matter; this is another screenshot:

  • Verified answer
    Martin Dráb Profile Picture
    237,801 Most Valuable Professional on at

    That something works in one system doesn't mean that it can't fail in another one. "It works in on my computer" is already adverbial.

    Look at WCF forums (rather than AX forums), and you'll find discussions about this error (e.g. here). You might be right that your message is too big.

  • saman0suke Profile Picture
    2,894 on at

    Well, I fixed it and it was a data problem in a table, the field with the error was properly populated in the other environment and not in DEV, a more detailed error message would have been helpful, anyway, I really appreciate the help, thanks!!!

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 AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans