【问题标题】:Operation was aborted while establishing a connection建立连接时操作被中止
【发布时间】:2019-07-29 11:49:07
【问题描述】:

间歇性 WCF 错误但无法在本地重现

在我们的应用程序中,在建立与 net.tcp://XXXX 的连接时,操作被中止。我们正在使用 WPF 应用程序连接 WCF 服务。

试图通过回收 IIS 池来重现错误,停止 WCF 服务但没有工作

在建立与 net.tcp://XXXX 的连接时操作被中止。

<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" />
                    </mtomMessageEncoding>

</binding>



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

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

【问题讨论】:

    标签: wpf wcf


    【解决方案1】:

    如果错误是间歇性的,而不是偶然的。什么时候会出现这样的错误?
    一般情况下,如果连接正常,由于涉及大文件传输,似乎与机器性能有关。 最后,自定义绑定使用http基地址而不是Nettcp协议地址,所以我认为不能使用nettcp基地址连接服务端点地址。托管服务时应该会抛出错误,如下所示。

    无法找到端点绑定到 CustomBinding 的基地址 与架构 http 匹配。注册的基地址方案是 [net.tcp]

    如果问题仍然存在,请随时告诉我。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2016-02-29
      • 1970-01-01
      相关资源
      最近更新 更多