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
Azure云服务上的WCF间歇返回http错误503_Wcf_Iis 8_Http Proxy_Azure Cloud Services_Http Status Code 503 - Fatal编程技术网

Azure云服务上的WCF间歇返回http错误503

Azure云服务上的WCF间歇返回http错误503,wcf,iis-8,http-proxy,azure-cloud-services,http-status-code-503,Wcf,Iis 8,Http Proxy,Azure Cloud Services,Http Status Code 503,我们有一个azure云服务,其中WCF作为web角色安装。该服务使用实体框架连接到azure db online。WPF客户端使用该服务,该客户端使用公司代理连接到web 有时客户端会收到错误:“服务器太忙”,内部异常为“HTTP 503-服务不可用” 为了调查此错误,我尝试通过远程桌面连接云服务的VM: 事件查看器:“应用程序”和“系统”部分中没有应用程序池崩溃或错误的迹象 FREB日志(激活规则):未记录任何内容 HTTPerr日志:没有失败请求的跟踪 我已激活WCF内部跟踪日志。日志正确跟

我们有一个azure云服务,其中WCF作为web角色安装。该服务使用实体框架连接到azure db online。WPF客户端使用该服务,该客户端使用公司代理连接到web

有时客户端会收到错误:“服务器太忙”,内部异常为“HTTP 503-服务不可用”

为了调查此错误,我尝试通过远程桌面连接云服务的VM:

  • 事件查看器:“应用程序”和“系统”部分中没有应用程序池崩溃或错误的迹象
  • FREB日志(激活规则):未记录任何内容
  • HTTPerr日志:没有失败请求的跟踪
  • 我已激活WCF内部跟踪日志。日志正确跟踪信息,但没有记录异常或错误
  • 在IIS上,我已更改:

    • 应用程序池从“ondemand”到“始终运行”
    • 队列限制
    • 禁用快速失效保护(仅用于测试)
    • 更改了应用程序池标识
    我还向WCF添加了遥测功能,以记录所有异常和一些请求跟踪。 没有任何帮助,错误继续随机出现

    今天,我在承载WCF的服务器上安装了WireShark,并捕获了入站流量。 甚至没有响应代码为的请求失败的迹象!=200,所有请求都是“http1.1200 OK”

    几天前,我在家工作,经常使用WPF客户端(不使用代理),错误从未出现

    可能与我们在工作中使用的公司代理有关

    在客户端和WCF配置下面:

    WPF客户端配置:

     <?xml version="1.0" encoding="utf-8"?>
    <configuration>
        <configSections>
      </configSections>
    
      <appSettings>
        <add key="ClientSettingsProvider.ServiceUri" value="" />
      </appSettings>
      </connectionStrings>
      </entityFramework>
      <startup>
        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
      </startup>
      <system.serviceModel>
        <bindings>
          <customBinding>
            <binding name="largedata"  closeTimeout="00:21:00" openTimeout="00:20:00" receiveTimeout="00:20:00" sendTimeout="00:20:00">
              <security  authenticationMode="UserNameOverTransport" messageSecurityVersion="WSSecurity10WSTrustFebruary2005WSSecureConversationFebruary2005WSSecurityPolicy11BasicSecurityProfile10" allowInsecureTransport="true" />
              <binaryMessageEncoding  maxReadPoolSize="2147483647" maxWritePoolSize="2147483647" compressionFormat="GZip">
                <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
              </binaryMessageEncoding>
              <httpTransport  bypassProxyOnLocal="True"
                              authenticationScheme="Basic"
                              useDefaultWebProxy="True" 
                              proxyAuthenticationScheme="Basic" 
                              keepAliveEnabled="True" 
                              maxBufferPoolSize="2147483647"
                              maxReceivedMessageSize="2147483647"
                              maxBufferSize="2147483647" />
            </binding>
          </customBinding>
        </bindings>
        <client>
          <endpoint address="http://wcfadress/Data.svc" binding="customBinding" bindingConfiguration="largedata" contract="DataService.DataService" name="largedata" />
        </client>                       
      </system.serviceModel>
      <runtime>
        <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
          <dependentAssembly>
            <assemblyIdentity name="Microsoft.Data.Edm" publicKeyToken="31bf3856ad364e35" culture="neutral" />
            <bindingRedirect oldVersion="0.0.0.0-5.6.4.0" newVersion="5.6.4.0" />
          </dependentAssembly>
          <dependentAssembly>
            <assemblyIdentity name="Microsoft.Data.Services.Client" publicKeyToken="31bf3856ad364e35" culture="neutral" />
            <bindingRedirect oldVersion="0.0.0.0-5.6.4.0" newVersion="5.6.4.0" />
          </dependentAssembly>
          <dependentAssembly>
            <assemblyIdentity name="Microsoft.Data.OData" publicKeyToken="31bf3856ad364e35" culture="neutral" />
            <bindingRedirect oldVersion="0.0.0.0-5.6.4.0" newVersion="5.6.4.0" />
          </dependentAssembly>
        </assemblyBinding>
      </runtime>
      <system.net>
        <defaultProxy enabled="true" useDefaultCredentials="true">
          <proxy proxyaddress="http://proxyadress" ></proxy>
        </defaultProxy>
            <settings>
          <servicePointManager expect100Continue="false" />
        </settings>
      </system.net>
      <system.web>
        <membership defaultProvider="ClientAuthenticationMembershipProvider">
          <providers>
            <add name="ClientAuthenticationMembershipProvider" type="System.Web.ClientServices.Providers.ClientFormsAuthenticationMembershipProvider, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" serviceUri="" />
          </providers>
        </membership>
        <roleManager defaultProvider="ClientRoleProvider" enabled="true">
          <providers>
            <add name="ClientRoleProvider" type="System.Web.ClientServices.Providers.ClientRoleProvider, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" serviceUri="" cacheTimeout="86400" />
          </providers>
        </roleManager>
      </system.web>
    </configuration>
    
    
    
    WCF配置

    <?xml version="1.0" encoding="utf-8"?>
    <configuration>
    <configSections>
        <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
        <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
      </configSections>
    <system.diagnostics>
        <trace>
            <listeners>
                <add type="Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener, Microsoft.WindowsAzure.Diagnostics, Version=2.6.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" name="AzureDiagnostics">
                    <filter type="" />
                </add>
            </listeners>
        </trace>
      <sources>
          <source name="System.ServiceModel" switchValue="Critical, Error, Warning" propagateActivity="true">
            <listeners>
              <add name="traceListener" type="System.Diagnostics.XmlWriterTraceListener" initializeData="c:\temp\TracesWCF.svclog" />
            </listeners>
          </source>
        </sources>
    </system.diagnostics>
    <connectionStrings>
      <add name="Clio" providerName="System.Data.EntityClient" connectionString="metadata=res://*/DataMadel.csdl|res://*/DataMadel.ssdl|res://*/DataMadel.msl;provider=System.Data.SqlClient;provider connection string=&quot;Data Source=*****;Initial Catalog=*****;Language=Italian;Integrated Security=False;*****;Password=*****;Connection Timeout=600;MultipleActiveResultSets=True;Encrypt=True;Min Pool Size=20;Max Pool Size=50;TrustServerCertificate=False&quot;" />
      </connectionStrings>
      <entityFramework>
        <defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework" />
      </entityFramework>
      <appSettings>
        <add key="aspnet:UseTaskFriendlySynchronizationContext" value="true" />
      </appSettings>
      <system.web>
       <compilation debug="true" targetFramework="4.5" />
        <httpRuntime targetFramework="4.5" maxRequestLength="202400" />
        <httpModules>
          <add name="ApplicationInsightsWebTracking" type="Microsoft.ApplicationInsights.Extensibility.Web.RequestTracking.WebRequestTrackingModule, Microsoft.ApplicationInsights.Extensibility.Web" />
        </httpModules>
      </system.web>
      <system.serviceModel>
         <diagnostics>
          <messageLogging
                  logEntireMessage="true"
                  logMalformedMessages="false"
                  logMessagesAtServiceLevel="true"
                  logMessagesAtTransportLevel="true"
                  maxMessagesToLog="400"
                  maxSizeOfMessageToLog="6000"/>
        </diagnostics>
        <bindings>
           <customBinding>
            <binding name="largedata" closeTimeout="00:21:00" openTimeout="00:20:00" receiveTimeout="00:20:00" sendTimeout="00:50:00">
                 <security authenticationMode="UserNameOverTransport" messageSecurityVersion="WSSecurity10WSTrustFebruary2005WSSecureConversationFebruary2005WSSecurityPolicy11BasicSecurityProfile10" allowInsecureTransport="true" />
              <binaryMessageEncoding maxReadPoolSize="2147483647" maxWritePoolSize="2147483647" compressionFormat="GZip">
                <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
              </binaryMessageEncoding>
              <httpTransport maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647" maxBufferSize="2147483647" />
            </binding>
          </customBinding>
        </bindings>
        <services>
          <service name="ArchivioStorico.Service.DataService" behaviorConfiguration="Auth">
            <endpoint address="" binding="customBinding" bindingConfiguration="largedata" contract="ArchivioStorico.Service.DataService" />
            <endpoint address="basicHttp" binding="basicHttpBinding" contract="ArchivioStorico.Service.DataService" />
          </service>
         </services>
        <behaviors>
          <serviceBehaviors>
            <behavior name="Auth">
              <!-- 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="true" />
              <dataContractSerializer maxItemsInObjectGraph="2147483647" />
              <serviceThrottling maxConcurrentCalls="1300" maxConcurrentSessions="1300" maxConcurrentInstances="1300"></serviceThrottling>
              <serviceCredentials>
                <userNameAuthentication userNamePasswordValidationMode="Custom" customUserNamePasswordValidatorType="ArchivioStorico.Service.CustomValidator.CustomUserNameValidator, App_Code" />
              </serviceCredentials>
            </behavior>   
    
           </serviceBehaviors>
          <endpointBehaviors>
            <behavior>
              <dataContractSerializer maxItemsInObjectGraph="2147483647" />
            </behavior>
          </endpointBehaviors>
        </behaviors>
        <protocolMapping>
          <add binding="basicHttpsBinding" scheme="https" />
          <add binding="basicHttpBinding" scheme="http" />
          <add binding="webHttpBinding" scheme="http" />
        </protocolMapping>    
        <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
      </system.serviceModel>
      <system.webServer>
        <modules runAllManagedModulesForAllRequests="true">
          <remove name="ApplicationInsightsWebTracking" />
          <add name="ApplicationInsightsWebTracking" type="Microsoft.ApplicationInsights.Extensibility.Web.RequestTracking.WebRequestTrackingModule, Microsoft.ApplicationInsights.Extensibility.Web" preCondition="managedHandler" />
        </modules>
        <!--
            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" />
        <security>
          <requestFiltering>
            <!--Increase 'maxAllowedContentLength' to needed value: 100mb (value is in bytes)-->
            <requestLimits maxAllowedContentLength="204857600" />
          </requestFiltering>
        </security>
        <validation validateIntegratedModeConfiguration="false" />
      </system.webServer>
    
      <runtime>
    
        <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
    
          <dependentAssembly>
    
            <assemblyIdentity name="Microsoft.Data.Edm" publicKeyToken="31bf3856ad364e35" culture="neutral" />
    
            <bindingRedirect oldVersion="0.0.0.0-5.6.4.0" newVersion="5.6.4.0" />
    
          </dependentAssembly>
    
          <dependentAssembly>
    
            <assemblyIdentity name="Microsoft.Data.Services.Client" publicKeyToken="31bf3856ad364e35" culture="neutral" />
    
            <bindingRedirect oldVersion="0.0.0.0-5.6.4.0" newVersion="5.6.4.0" />
    
          </dependentAssembly>
    
          <dependentAssembly>
    
            <assemblyIdentity name="Microsoft.Data.OData" publicKeyToken="31bf3856ad364e35" culture="neutral" />
    
            <bindingRedirect oldVersion="0.0.0.0-5.6.4.0" newVersion="5.6.4.0" />
    
          </dependentAssembly>
    
        </assemblyBinding>
    
      </runtime>
      <system.net>
        <settings>
          <servicePointManager expect100Continue="false" />
        </settings>
      </system.net>
    </configuration>