【问题标题】:WCF webservice seems to be going in an infinite loopWCF 网络服务似乎陷入了无限循环
【发布时间】:2019-02-20 20:03:12
【问题描述】:

我创建了一个 Web 服务,我在其中调用一个方法并记录到一个文本文件。它似乎无限次地重新启动此方法,因为它一直在记录同一行。我怀疑这可能是我的配置文件中有问题,有人可以验证绑定等吗?

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <appSettings>

  </appSettings>
  <system.web>
    <customErrors mode="Off"/>
    <compilation targetFramework="4.6.1" />
    <httpRuntime targetFramework="4.6.1" />
  </system.web>
  <system.serviceModel>
    <services>
      <service name="TLS_Service.Service1">
        <endpoint address="" binding="webHttpBinding" contract="TLS_Service.IService1" behaviorConfiguration="webBehavior" />
      </service>
    </services>
    <behaviors>
      <serviceBehaviors>
        <behavior>
          <!-- To avoid disclosing metadata information, set the values below to false before deployment -->
          <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" />
          <!-- To receive exception details in faults for debugging purposes, set the value below to true.  Set to false before deployment to avoid disclosing exception information -->
          <serviceDebug includeExceptionDetailInFaults="false" />
        </behavior>
      </serviceBehaviors>
      <endpointBehaviors>
        <behavior name="webBehavior">
          <webHttp />
        </behavior>
      </endpointBehaviors>
    </behaviors>
    <protocolMapping>
      <add binding="basicHttpsBinding" scheme="https" />
    </protocolMapping>
    <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
  </system.serviceModel>
  <system.webServer>
    <modules runAllManagedModulesForAllRequests="true" />
    <!--
        To browse web app root directory during debugging, set the value below to true.
        Set to false before deployment to avoid disclosing web app folder information.
      -->
    <directoryBrowse enabled="true" />
  </system.webServer>
  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="Microsoft.SharePoint.Client" publicKeyToken="71e9bce111e9429c" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-14.0.0.0" newVersion="14.0.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="Microsoft.SharePoint.Client.Runtime" publicKeyToken="71e9bce111e9429c" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-14.0.0.0" newVersion="14.0.0.0" />
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
</configuration>

【问题讨论】:

  • 从您的代码 sn-ps 中,我可以看到任何明显的错误。您似乎想通过 http 模式发布 Web 服务。如果要在客户端接受服务器错误,可以将 CustomErrors 模式更改为 On。问题的错误详情是什么?

标签: wcf infinite-loop wcf-binding


【解决方案1】:

这里的问题似乎是:服务器内存不足/Web 服务代码中有太多 ExecuteQuery 请求。

【讨论】:

    猜你喜欢
    • 2015-03-27
    • 1970-01-01
    • 1970-01-01
    • 2015-11-20
    • 2015-08-21
    • 2020-05-13
    相关资源
    最近更新 更多