English 中文(简体)
WCF服务连接问题 - 可能是安全问题?
原标题:
  • 时间:2009-03-01 23:58:59
  •  标签:

I am trying to debug a WCF service. This client has been able to connect in the past, but now I cannot connect. The service is deployed to a server. I can hit the server s service page with the browser and I see the instructions for generating a client. I re-generated the client proxy and configuration file using svcutil.

客户端启动,但第一次调用服务在1分钟超时后返回错误。同时,我可以连接到运行在服务器上的服务并逐步执行其中的代码。我可以看到我的客户端从未注册。服务器代码中对此调用的断点未被命中。出于某种原因,我无法进入服务器代码(但我可以将调试器连接到服务器上的服务):

Unable to automatically step into the server. 
Connecting to the server machine  shuttle  failed. 
Please install the Visual Studio 2008 Remote Debugger on the 
server to enable this functionality.

The remote debugger is installed and running, or course. I am getting this error after a long timeout:

Client is unable to finish the security negotiation within the 
configured timeout (00:00:00).  The current negotiation leg is 1 (00:00:00).

当我设置安全模式=无,并增加超时时间时,错误信息会改变为

The open operation did not complete within the allotted timeout of 00:02:00.
The time allotted to this operation may have been a portion of a 
longer timeout.

我没有任何防火墙运行,并且我在Ethereal上看到请求进入服务器。我正在查看TCP流并不能确定为什么协商失败。事件日志中没有任何相关信息。我已经快没有办法了,希望能得到提示。

客户端app.config包含svcutil生成的部分:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
    <system.serviceModel>
        <bindings>
            <wsDualHttpBinding>
                <binding name="WSDualHttpBinding_SportRadarDCS" 
                    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="Text" 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>
        </bindings>
        <client>
            <endpoint
                 address="...."
                binding="wsDualHttpBinding" 
                    bindingConfiguration="WSDualHttpBinding_SportRadarDCS"
                    contract="SportRadarDCS" 
                    name="WSDualHttpBinding_SportRadarDCS">
                <identity>
                    <userPrincipalName value=".. my domain user ..." />
                </identity>
            </endpoint>
        </client>
    </system.serviceModel>
</configuration>
最佳回答

看看WCF跟踪。 如果您在服务主机上运行此操作,它将提供正在发生的单个WCF调用,并且应该足够让您找出配置的哪个部分有问题。

我发现连接问题只有这种方法才能排查原因。

MSDN关于WCF跟踪应用程序的说明

一个好的教程,帮助你理解MSDN。

问题回答

暂无回答




相关问题
热门标签