Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/wcf/4.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
WCF:尝试在不存在的网络连接上执行操作_Wcf_Wcf Client - Fatal编程技术网

WCF:尝试在不存在的网络连接上执行操作

WCF:尝试在不存在的网络连接上执行操作,wcf,wcf-client,Wcf,Wcf Client,我现在在控制台应用程序中托管wcf服务,有时我在wcf跟踪程序中遇到此错误。“尝试在不存在的网络连接上执行操作”。我检查了事件查看器,那里什么都没有。 只有当客户从内部网络呼叫我们的服务器(有时仅限于此)时,才会发生这种情况,而且工作正常 我的配置如下所示: WCF主机配置: <system.serviceModel> <behaviors> <serviceBehaviors > <behavior name="MyServiceBeha

我现在在控制台应用程序中托管wcf服务,有时我在wcf跟踪程序中遇到此错误。“尝试在不存在的网络连接上执行操作”。我检查了事件查看器,那里什么都没有。 只有当客户从内部网络呼叫我们的服务器(有时仅限于此)时,才会发生这种情况,而且工作正常

我的配置如下所示: WCF主机配置:

 <system.serviceModel>
<behaviors>
  <serviceBehaviors >
    <behavior name="MyServiceBehavior">
      <serviceMetadata httpGetEnabled="false" />
      <serviceDebug includeExceptionDetailInFaults="true" />
  </behavior>
  </serviceBehaviors>
</behaviors>
<bindings>
  <wsHttpBinding>
    <binding name="wsHttpBindingConfig" closeTimeout="00:05:00" openTimeout="00:05:00"
      receiveTimeout="00:05:00" sendTimeout="00:05:00" maxBufferPoolSize="2147483647"
      maxReceivedMessageSize="2147483647" messageEncoding="Text">
      <readerQuotas maxDepth="32" maxStringContentLength="2147483647"
        maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
      <security mode="None">
        <transport clientCredentialType="None" proxyCredentialType="None" />
        <message clientCredentialType="None" negotiateServiceCredential="false"
          establishSecurityContext="false" />
      </security>
    </binding>
  </wsHttpBinding>
</bindings>
<services>
  <service name="HSL.MM.Activities.FacilityHandlers.FacilitiesHandler" behaviorConfiguration="MyServiceBehavior">
    <endpoint address="http://localhost:8081/facilitiesService" bindingConfiguration="wsHttpBindingConfig" binding="wsHttpBinding" contract="HSL.MM.Activities.Interface.FacilityHandlers.IFacilitiesHandler"/>
  </service>
  <service name="HSL.MM.Activities.ContractHandlers.ContractHandler" behaviorConfiguration="MyServiceBehavior">
    <endpoint address="http://localhost:8081/contractService"  bindingConfiguration="wsHttpBindingConfig" binding="wsHttpBinding" contract="HSL.MM.Activities.Interface.ContractHandlers.IContractHandler"/>
  </service>
  <service name="HSL.MM.Activities.ContractHandlers.ModuleHandler" behaviorConfiguration="MyServiceBehavior">
    <endpoint address="http://localhost:8081/moduleService" bindingConfiguration="wsHttpBindingConfig" binding="wsHttpBinding" contract="HSL.MM.Activities.Interface.ContractHandlers.IModuleHandler"/>
  </service>
  <service name="HSL.MM.Activities.LocationHandlers.LocationsHandler" behaviorConfiguration="MyServiceBehavior">
    <endpoint address="http://localhost:8081/locationsService"  bindingConfiguration="wsHttpBindingConfig" binding="wsHttpBinding" contract="HSL.MM.Activities.Interface.LocationHandlers.ILocationsHandler"/>
  </service>
  <service name="HSL.Client.Activities.ClientHandler" behaviorConfiguration="MyServiceBehavior">
    <endpoint address="http://localhost:8081/clientService"  bindingConfiguration="wsHttpBindingConfig" binding="wsHttpBinding" contract="HSL.Client.Activities.Interface.IClientHandler"/>
  </service>
  <service name="HSL.MM.Activities.ProductHandler" behaviorConfiguration="MyServiceBehavior">
    <endpoint address="http://localhost:8081/productService"  bindingConfiguration="wsHttpBindingConfig" binding="wsHttpBinding" contract="HSL.MM.Activities.Interface.IProductHandler"/>
  </service>
  <service name="HSL.MM.Activities.DistributorHandlers.DistributorsHandler" behaviorConfiguration="MyServiceBehavior">
    <endpoint address="http://localhost:8081/distributorsService" bindingConfiguration="wsHttpBindingConfig" binding="wsHttpBinding" contract="HSL.MM.Activities.Interface.DistributorHandlers.IDistributorsHandler"/>
  </service>
  <service name="HSL.MM.Activities.InformationSourceHandlers.InformationSourcesHandler" behaviorConfiguration="MyServiceBehavior">
    <endpoint address="http://localhost:8081/informationSourcesService" bindingConfiguration="wsHttpBindingConfig" binding="wsHttpBinding" contract="HSL.MM.Activities.Interface.InformationSourceHandlers.IInformationSourcesHandler"/>
  </service>
  <service name="HSL.MM.Activities.ProductStatisticHandlers.ProductStatisticsHandler" behaviorConfiguration="MyServiceBehavior">
    <endpoint address="http://localhost:8081/productStatisticsService" bindingConfiguration="wsHttpBindingConfig" binding="wsHttpBinding" contract="HSL.MM.Activities.Interface.ProductStatisticHandlers.IProductStatisticsHandler"/>
  </service>
  <service name="HSL.MM.Activities.SecurityHandler" behaviorConfiguration="MyServiceBehavior">
    <endpoint address="http://localhost:8081/securityService" bindingConfiguration="wsHttpBindingConfig" binding="wsHttpBinding" contract="HSL.MM.Activities.Interface.ISecurityHandler"/>
  </service>
  <service name="HSL.MM.Activities.ProductStatisticHandlers.ProductStatisticIntegrationHandler" behaviorConfiguration="MyServiceBehavior">
    <endpoint address="http://localhost:8081/productStatisticIntegrationService" bindingConfiguration="wsHttpBindingConfig" binding="wsHttpBinding" contract="HSL.MM.Activities.Interface.ProductStatisticHandlers.IProductStatisticIntegrationHandler"/>
  </service>
</services>


客户端配置如下所示:

  <system.serviceModel>
<bindings>
  <wsHttpBinding>
    <binding name="wsHttpBindigConfig" maxReceivedMessageSize="2147483647" maxBufferPoolSize="2147483647" receiveTimeout="00:05:00" sendTimeout="00:05:00">
      <readerQuotas maxDepth="32" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
      <security mode="None">
        <message clientCredentialType="None" />
        <transport clientCredentialType="None">
        </transport>
      </security>
    </binding>
  </wsHttpBinding>
</bindings>
<client>
  <endpoint address="http://***.***.**.**:8081/facilitiesService" binding="wsHttpBinding" bindingConfiguration="wsHttpBindigConfig" contract="HSL.MM.Activities.Interface.FacilityHandlers.IFacilitiesHandler" name="FacilitiesService"/>
  <endpoint address="http://***.***.**.**:8081/contractService" binding="wsHttpBinding" bindingConfiguration="wsHttpBindigConfig" contract="HSL.MM.Activities.Interface.ContractHandlers.IContractHandler" name="ContractService"/>
  <endpoint address="http://***.***.**.**:8081/moduleService" binding="wsHttpBinding" bindingConfiguration="wsHttpBindigConfig" contract="HSL.MM.Activities.Interface.ContractHandlers.IModuleHandler" name="ModuleService"/>
  <endpoint address="http://***.***.**.**:8081/locationsService" binding="wsHttpBinding" bindingConfiguration="wsHttpBindigConfig" contract="HSL.MM.Activities.Interface.LocationHandlers.ILocationsHandler" name="LocationsService"/>
  <endpoint address="http://***.***.**.**:8081/clientService" binding="wsHttpBinding" bindingConfiguration="wsHttpBindigConfig" contract="HSL.Client.Activities.Interface.IClientHandler" name="ClientService"/>
  <endpoint address="http://***.***.**.**:8081/productService" binding="wsHttpBinding" bindingConfiguration="wsHttpBindigConfig" contract="HSL.MM.Activities.Interface.IProductHandler" name="ProductService"/>
  <endpoint address="http://***.***.**.**:8081/distributorsService" binding="wsHttpBinding" bindingConfiguration="wsHttpBindigConfig" contract="HSL.MM.Activities.Interface.DistributorHandlers.IDistributorsHandler" name="DistributorsService"/>
  <endpoint address="http://***.***.**.**:8081/informationSourcesService" binding="wsHttpBinding" bindingConfiguration="wsHttpBindigConfig" contract="HSL.MM.Activities.Interface.InformationSourceHandlers.IInformationSourcesHandler" name="InformationSourcesService"/>
  <endpoint address="http://***.***.**.**:8081/productStatisticsService" binding="wsHttpBinding" bindingConfiguration="wsHttpBindigConfig" contract="HSL.MM.Activities.Interface.ProductStatisticHandlers.IProductStatisticsHandler" name="ProductStatisticsService"/>
  <endpoint address="http://***.***.**.**:8081/securityService" binding="wsHttpBinding" bindingConfiguration="wsHttpBindigConfig" contract="HSL.MM.Activities.Interface.ISecurityHandler" name="securityService"/>
  <endpoint address="http://***.***.**.**:8081/productStatisticIntegrationService" binding="wsHttpBinding" bindingConfiguration="wsHttpBindigConfig" contract="HSL.MM.Activities.Interface.ProductStatisticHandlers.IProductStatisticIntegrationHandler" name="productStatisticIntegrationService"/>
</client>


最有趣的是它有时会发生,但并不总是原来问题出在端口上。8081用于代理,当来自同一网络的两个用户正在使用应用程序时,出现问题。一旦我们把8080端口,它的工作正常

愚蠢问题的愚蠢例外:)