0

我有一个netTcp WCF服务在远程机器上的 Windows 服务中运行。windows服务以用户身份运行mydomain\u2

Windows 服务托管 WCF的.config文件是

<security mode="None">
            <transport clientCredentialType="None" />
            <message clientCredentialType="None" />
</security>

现在当我跑

svcutil.exe http://wcfhostmachine:8000/MyWCFService?wsdl

客户端output.config具有以下安全部分:

<security mode="None">
     <transport clientCredentialType="Windows" protectionLevel="EncryptAndSign" />
     <message clientCredentialType="Windows" />
</security>

它们是不同的。为什么??我应该更改客户端以匹配服务器吗?

虽然我仍然可以向WCF服务发送指令并对其进行处理,但当 Visual Studio 尝试进入WCF远程主机上运行的代码时,我得到了臭名昭著的:

无法自动调试“.....”。连接到服务器计算机失败。目标计算机上的 Visual Studio 远程调试器无法连接回此计算机。确保DNS在目标计算机上正确配置。

不用说DNS很好。

我能想到我遇到这种情况的唯一其他原因是因为我的 Visual Studio 运行为mydomain\u1并且服务在远程计算机上运行为mydomain\u2.

过去有没有人面临/解决过这个问题?

更多信息

下面是我的主机服务的 App.config。我是否会因为没有 mex 端点而遇到此问题?

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <system.serviceModel>
    <services>
      <service name="my.Indexer" behaviorConfiguration="IndexerServiceBehavior">
        <host>
          <baseAddresses>
            <add baseAddress="http://hostmachine:8000/Indexer"/>
          </baseAddresses>
        </host>
        <endpoint address="net.tcp://hostmachine:9000/Indexer"
                  binding="netTcpBinding"
                  bindingConfiguration="Binding1"
                  contract="my.IIndexer" />
      </service>
    </services>
    <bindings>
      <netTcpBinding>
        <binding name="Binding1"
                     hostNameComparisonMode="StrongWildcard"
                     sendTimeout="00:10:00"
                     maxReceivedMessageSize="65536"
                     transferMode="Buffered"
                     portSharingEnabled="false">
          <security mode="None">
            <transport clientCredentialType="None" />
            <message clientCredentialType="None" />
          </security>

        </binding>
      </netTcpBinding>
    </bindings>
    <behaviors>
      <serviceBehaviors>
        <behavior name="IndexerServiceBehavior">
          <serviceMetadata httpGetEnabled="true" httpGetUrl=""/>
          <serviceDebug includeExceptionDetailInFaults="False" />
        </behavior>
      </serviceBehaviors>
    </behaviors>
  </system.serviceModel>
</configuration>
4

1 回答 1

2

它们是相同的——在这种情况下,所有相关的只是两端的 mode="None"。<security>一旦将模式设置为无,标签内的其余部分就完全无关紧要了。

svcutil.exe 创建的只是系统默认值。

马克

于 2009-08-28T18:28:49.760 回答