Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/326.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 联合国域名系统_C#_Wcf_Nettcpbinding_Workgroup - Fatal编程技术网

C# 联合国域名系统

C# 联合国域名系统,c#,wcf,nettcpbinding,workgroup,C#,Wcf,Nettcpbinding,Workgroup,我已经使用NetTCP绑定开发了WCF windows服务。当wcf客户端和wcf服务都在同一个系统上时,其工作正常 当两个系统都在工作组not中时出错-客户端和服务在不同的计算机上 请建议我需要更改的配置 远程地址8005的SocketId:61017335发生连接重置错误 错误:System.ServiceModel.CommunicationException:套接字连接已中止。这可能是由于处理消息时出错、远程主机超过接收超时或基础网络资源问题造成的。本地套接字超时为“00:00:58.9

我已经使用NetTCP绑定开发了WCF windows服务。当wcf客户端和wcf服务都在同一个系统上时,其工作正常

当两个系统都在工作组not中时出错-客户端和服务在不同的计算机上

请建议我需要更改的配置

远程地址8005的SocketId:61017335发生连接重置错误

错误:System.ServiceModel.CommunicationException:套接字连接已中止。这可能是由于处理消息时出错、远程主机超过接收超时或基础网络资源问题造成的。本地套接字超时为“00:00:58.9879193”。-->System.Net.Sockets.SocketException:远程主机强制关闭了现有连接

我正在使用证书身份验证—我知道没有域,我就没有必要的Kerberos基础结构来验证UPN和SPN,但这不应该解决,因为我正在使用证书

客户端的配置文件

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <system.serviceModel>
    <client>
      <endpoint kind="discoveryEndpoint" address="net.tcp://localhost:8005/Probe" binding="netTcpBinding" bindingConfiguration="RequestReplyNetTcpBinding">
      </endpoint>
      <endpoint binding="netTcpBinding" bindingConfiguration="RequestReplyNetTcpBinding" contract="Test2ServLib.IService1" behaviorConfiguration="LargeEndpointBehavior">
        <identity>  
          <dns value="WCFServer" />  
        </identity>  
      <!--The behaviorConfiguration is required to enable WCF deserialization of large data sets -->
      </endpoint>
    </client>
 <behaviors>
      <endpointBehaviors>
        <behavior name="disableEndpointDiscovery">
          <endpointDiscovery enabled="false" />
          <!--The behavior is required to enable WCF deserialization of large data sets -->
          <dataContractSerializer maxItemsInObjectGraph="2147483647" />
          <clientCredentials>
            <clientCertificate findValue="WCFClient"
                               storeLocation="LocalMachine"
                               storeName="TrustedPeople"
                               x509FindType="FindBySubjectName" />
                        <serviceCertificate >  
                            <authentication certificateValidationMode="PeerTrust" revocationMode="NoCheck"/>
                        </serviceCertificate> 
          </clientCredentials>
        </behavior>
        <behavior name="LargeEndpointBehavior">
          <!--The behavior is required to enable WCF deserialization of large data sets -->
          <dataContractSerializer maxItemsInObjectGraph="2147483647" />
            <clientCredentials>
              <clientCertificate findValue="WCFClient"
                                 storeLocation="LocalMachine"
                                 storeName="TrustedPeople"
                                 x509FindType="FindBySubjectName" />
                        <serviceCertificate >  
                            <authentication certificateValidationMode="PeerTrust" revocationMode="NoCheck"/>
                        </serviceCertificate> 
            </clientCredentials>
        </behavior>
      </endpointBehaviors>
    </behaviors>
    <bindings>
      <netTcpBinding>
        <binding name="RequestReplyNetTcpBinding" receiveTimeout="05:00:00" openTimeout="00:00:59" closeTimeout="00:00:59" maxBufferPoolSize="524288" maxBufferSize="25000000" maxConnections="50" maxReceivedMessageSize="25000000" sendTimeout="00:05:00" listenBacklog="1500">
          <reliableSession ordered="false" inactivityTimeout="00:01:00" enabled="true" />
          <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
          <security>
            <message clientCredentialType="Certificate"/>
          </security>
        </binding>
      </netTcpBinding>
    </bindings>
  </system.serviceModel>
</configuration>

服务配置

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <system.serviceModel>
<behaviors>
  <serviceBehaviors>
    <behavior name="announcementBehavior">
      <!--The following behavior attribute is required to enable WCF serialization of large data sets -->
      <dataContractSerializer maxItemsInObjectGraph="2147483647"/>
      <serviceDiscovery>
        <announcementEndpoints>
          <endpoint kind="announcementEndpoint"
        address="net.tcp://localhost:8005/Announcement"
        binding="netTcpBinding"
        bindingConfiguration="RequestReplyNetTcpBinding"/>
        </announcementEndpoints>
      </serviceDiscovery>
      <serviceThrottling
              maxConcurrentCalls="1500"
              maxConcurrentSessions="1500"
              maxConcurrentInstances="1500"/>
      <serviceCredentials>
        <serviceCertificate findValue="WCFServer"
                            storeLocation="LocalMachine"
                            storeName="TrustedPeople"
                            x509FindType="FindBySubjectName" />
        <clientCertificate>
          <authentication certificateValidationMode="PeerTrust" trustedStoreLocation="LocalMachine" revocationMode="NoCheck"/>
        </clientCertificate>
      </serviceCredentials>
    </behavior>
 </serviceBehaviors>  
 </behaviors> 
 <service name="Test2ServLib.IService1"
   behaviorConfiguration="announcementBehavior">
    <host>
      <baseAddresses>
        <add baseAddress="net.tcp://localhost:8006/Service1"/>
      </baseAddresses>
    </host>
    <endpoint binding="netTcpBinding"
              bindingConfiguration="RequestReplyNetTcpBinding"
              contract="Test2ServLib.IService1"
              behaviorConfiguration="LargeEndpointBehavior" />
        <bindings>  
            <netTcpBinding>  
                <binding name = "RequestReplyNetTcpBinding">  
                    <security>  
                        <message clientCredentialType="Certificate" />  
                    </security>  
                </binding>  
            </netTcpBinding>  
        </bindings>  
  </system.serviceModel>
</configuration>


请共享服务和客户端配置添加了服务和客户端配置。我在您之前的帖子中回复了您。很抱歉,我没有帮你解决这个问题。我试图利用你提供的信息重现你的问题,但没有成功。我没有遇到你提到的问题。我认为这可能是由于TLS版本不一致造成的。您尝试使客户端的.net framework版本与服务器的.net framework版本一致,以查看问题是否可以解决。我的客户端和服务器使用的是.net framework 4.7.2,操作系统是windows 10。能否请在服务端打开WCF跟踪,以便我们了解服务拒绝调用的原因?请分享服务和客户端配置添加服务和客户端配置时,我在你之前的帖子中回复了你。很抱歉,我没有帮你解决这个问题。我试图利用你提供的信息重现你的问题,但没有成功。我没有遇到你提到的问题。我认为这可能是由于TLS版本不一致造成的。您尝试使客户端的.net framework版本与服务器的.net framework版本一致,以查看问题是否可以解决。我的客户端和服务器使用的是.net framework 4.7.2,操作系统是windows 10。能否请在服务端打开WCF跟踪,以便我们了解服务拒绝调用的原因?