2009-03-01 61 views
2

我想调试一个WCF服务。这个客户端以前能够连接,但现在我无法连接。 服务部署到服务器。我可以通过浏览器访问服务器的服务页面,并查看生成客户端的说明。 我使用svcutil重新生成了客户端代理和配置文件。WCF服务连接问题 - 也许安全?

客户端启动,但第一次调用服务会在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. 

远程调试安装并运行,或课程。 我长超时后收到此错误:

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> 

回答

8

看一看WCF跟踪。如果你在你的服务主机上运行它,它会给你发生的单个WCF调用,并且应该足以让你找出你的配置的哪部分被盗用。

我发现与连接问题,这是唯一的方法来解决问题的唯一方法。

MSDN on WCF Tracing your application

A good tutorial to help you understand the MSDN

+1

谢谢,非常有帮助。我发现的错误是:没有可以通过操作'http://schemas.xmlsoap.org/ws/2005/02/rm/CreateSequence'接受消息的频道。我会从这里拿走。 – cdonner 2009-03-02 00:55:12