【问题标题】:open operation did not complete within allotted time wcf wsdualhttpbinding打开操作未在分配的时间内完成 wcf wsdualhttpbinding
【发布时间】:2012-02-01 22:27:30
【问题描述】:

我在远程机器上的 iis 中托管了 wcf 服务,并尝试从另一台机器访问该服务。两台机器都在同一个域中。客户端的 app.config:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <system.serviceModel>
        <bindings>
            <wsDualHttpBinding>
                <binding name="WSDualHttpBinding_IReportReceiver" closeTimeout="00:01:00"
                    openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
                    bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard"
                    maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
                    messageEncoding="Mtom" textEncoding="utf-8" useDefaultWebProxy="true">
                    <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
                        maxBytesPerRead="4096" maxNameTableCharCount="16384" />
                    <reliableSession ordered="true" inactivityTimeout="00:10:00" />
                    <security mode="None">
                        <message clientCredentialType="Windows" negotiateServiceCredential="true"
                            algorithmSuite="Default" />
                    </security>
                </binding>
            </wsDualHttpBinding>
        </bindings>
        <client>
            <endpoint address="http://nts0104:5950/ReportReceiver.svc"
                binding="wsDualHttpBinding" bindingConfiguration="WSDualHttpBinding_IReportReceiver"
                contract="ServiceReference1.IReportReceiver" name="WSDualHttpBinding_IReportReceiver">
                <identity>
                    <userPrincipalName value="ReportServer\reportserver@ac.lp.acml.com" />
                </identity>
            </endpoint>
        </client>


    </system.serviceModel>
  <system.diagnostics>
    <sources>
      <source name="System.ServiceModel"
              switchValue="Error"
              propagateActivity="true">
        <listeners>
          <add name="traceListener"
              type="System.Diagnostics.XmlWriterTraceListener"
              initializeData= "c:\log\Traces.svclog" />
        </listeners>
      </source>
    </sources>
  </system.diagnostics>
  </configuration>

该服务在特定池和帐户 reportserver@ac.lp.acml.com 下运行。 不知道你会发生这种情况。冲浪了很多,没有任何帮助。请在你的解决方案中提供。 谢谢

【问题讨论】:

    标签: wcf


    【解决方案1】:

    这很可能是防火墙问题,因为 wsDualHttpBinding 尝试打开从服务器到客户端的连接(以支持回调)。在大多数稳健的网络环境中,这很可能会失败。

    我的建议是改用 NetTcpBinding,因为它将回调发送到客户端打开到服务器的同一连接

    我在博客上写过这个here

    【讨论】:

    • 我想使用 wsdualhttpbinding。所以任何其他解决方案请
    • 由于两台机器在同一个域中,我觉得这可能不是防火墙问题
    • 请记住,Windows 有一个内置防火墙,默认情况下会阻止传入连接。在域网络设置中也很可能有防火墙。出于兴趣,您为什么如此热衷于使用 wsDualHttpBinding?它比 NetTcpBinding 慢且不可靠
    • 我想通过互联网为客户端使用 wsdualhttpbinding
    • wsDualHttpBinding 不太可能在 Internet 上工作 - 您是在客户端和服务器之间还是在服务器和服务器之间使用它?
    【解决方案2】:

    终于让它与 wsDualHttpBinding 一起工作了。 在客户端的 app.config 中,在 binding 元素下添加了属性 useDefaultWebProxy="true"。

    <wsDualHttpBinding>
                    <binding name="WSDualHttpBinding_IReportReceiver" closeTimeout="00:01:00"
                        openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
                        bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard"
                        maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
                        messageEncoding="Mtom" textEncoding="utf-8" useDefaultWebProxy="true">
                        <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
                            maxBytesPerRead="4096" maxNameTableCharCount="16384" />
                        <reliableSession ordered="true" inactivityTimeout="00:10:00" />
                        <security mode="Message">
                            <message clientCredentialType="Windows" negotiateServiceCredential="true"
                                algorithmSuite="Default" />
                        </security>
                    </binding>
                </wsDualHttpBinding>
    

    【讨论】:

    • 有没有机会同时发布您的 web.config 和 app.config?以及留下有关您必须进行哪些防火墙更改的信息?
    猜你喜欢
    • 2012-07-30
    • 2016-12-03
    • 1970-01-01
    • 2018-03-17
    • 1970-01-01
    • 1970-01-01
    • 2011-09-07
    • 2011-08-04
    • 1970-01-01
    相关资源
    最近更新 更多