operation was aborted while establishing a connection RRS feed

  • Question

  • Intermittent WCF Error 

    In our application we are getting Operation was aborted while establishing a connection to net.tcp://XXXX. We are using WPF application to connect WCF service.


    Monday, July 29, 2019 11:38 AM

All replies

  • Hi,

    There are lots of factors that cause the error during the connection. 
    First, I suggest you check if the service works properly. We could check whether the service is available by using the WcfTestClient or accessing the WSDL page by typing the service metadata page in browser address bar.
    Second. The client communication might be blocked by the firewall. We might also need to provide client credentials to access the service.
    At last. I suggest you post your complete code (system.servicemodel section in configuration) on the server-side and on the client-side. Please refer to my previous example).
    Feel free to let me know if there is anything I can help with.
    Best Regards

    Tuesday, July 30, 2019 6:15 AM
  • Thanks for response.

    It is an Intermittent error which i get at the client side i.e. WPF

    Below is the configuration of service model

    <binding name="MTOMCustomBinding" closeTimeout="00:10:00" openTimeout="00:10:00"
    receiveTimeout="00:50:00" sendTimeout="00:10:00">
    <mtomMessageEncoding maxBufferSize="2147483647"  >
    <readerQuotas maxDepth="32" maxStringContentLength="22524288" maxArrayLength="22524288"
      maxBytesPerRead="22524288" maxNameTableCharCount="22524288" />

    <httpTransport bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" allowCookies="false"
       maxBufferPoolSize="22524288" maxReceivedMessageSize="2147483647" transferMode="Buffered"
       useDefaultWebProxy="true" authenticationScheme="Ntlm" realm="" maxBufferSize="2147483647" />

    <endpoint address="net.tcp://XXXX.svc" binding="customBinding" bindingConfiguration="MTOMCustomBinding" behaviorConfiguration="ServiceViewEventBehavior" contract="XXXXXXX">
    <userPrincipalName value="XXXXXX" />

    <behavior name="ServiceViewEventBehavior">
    <dataContractSerializer maxItemsInObjectGraph="2147483647" />

    Tuesday, July 30, 2019 8:54 AM
  • Hi,

    If the error is intermittent, not accidental. 
    When will such a mistake happen? 
    Under normal circumstances, if the connection works properly, it seems to have something to do with the performance of the machine because of the large file transfer involved.
    At last, the custom binding use http base address instead of Nettcp protocol address, so I don’t think the service endpoint address could be connected by using nettcp base address. It should throw an error when hosting the service, like below.

    Unable to find a base address with an endpoint bound to CustomBinding that matches the schema http. 
    The registered base address scheme is [net.tcp]

    Feel free to let me know if there is anything I can help with.
    Best Regards

    Wednesday, July 31, 2019 7:23 AM