开放操作没有在规定的时间内完成wcf wsdualhttpbinding

时间:2012-01-31 07:20:34

标签: wcf

我在远程计算机上的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下运行。 没有任何关于这种情况的线索。很多没有帮助。没有帮助.pls提供你的解决方案。 感谢

2 个答案:

答案 0 :(得分:1)

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

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

我在博客上发表了这篇文章here

答案 1 :(得分:0)

终于让它与wsDualHttpBinding一起工作了。 在客户端的app.config中,在绑定元素下添加了属性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>