WCF服务库请求太大

时间:2014-12-02 14:54:41

标签: .net wcf

我已经尝试了每个主题中的每个建议,并且“请求过大”#34;对于WCF服务库,它们都没有工作。我已经改变了绑定,设置配置等​​等,我完全被难倒了。

我希望有人能帮助我:

这是我的服务器端配置文件:

<?xml version="1.0"?>
<configuration>
  <appSettings>
    <add key="aspnet:UseTaskFriendlySynchronizationContext" value="true"/>
  </appSettings>
  <!--
    For a description of web.config changes see http://go.microsoft.com/fwlink/?LinkId=235367.

    The following attributes can be set on the <httpRuntime> tag.
      <system.Web>
        <httpRuntime targetFramework="4.5.1" />
      </system.Web>
  -->
  <system.web>
    <compilation strict="false" explicit="true" targetFramework="4.5.1"/>
    <httpRuntime targetFramework="4.5"/>
    <customErrors mode="Off"/>
  </system.web>
  <system.serviceModel>
          <services>
         <service name="MyService.MyService">
         <endpoint name="webHttpBinding"
                   address=""
                   binding="webHttpBinding"
                   bindingConfiguration="webHttpBinding"
                   contract="MyService.IMyFunctions"/>
      </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="true"/>
        </behavior>
      </serviceBehaviors>
    </behaviors>
    <protocolMapping>
      <add binding="webHttpBinding" scheme="http"/>
    </protocolMapping>
 <bindings>
    <webHttpBinding>
      <binding name="webHttpBinding" closeTimeout="00:10:00"
      openTimeout="00:10:00" receiveTimeout="00:10:00" sendTimeout="00:10:00"
      maxBufferSize="2147483647" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647">
        <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647"
          maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
      </binding>
    </webHttpBinding>
   </bindings>
    <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true"/>
  </system.serviceModel>
  <system.webServer>
    <modules runAllManagedModulesForAllRequests="true">
      <add name="UrlRoutingModule"
           type="System.Web.Routing.UrlRoutingModule, &#xD;&#xA;          System.Web.Routing, Version=4.0.0.0, &#xD;&#xA;          Culture=neutral, &#xD;&#xA;          PublicKeyToken=31BF3856AD364E35" />
    </modules>
    <handlers>
      <add name="UrlRoutingHandler"
         preCondition="integratedMode"
         verb="*" path="UrlRouting.axd"
         type="System.Web.HttpForbiddenHandler, &#xD;&#xA;         System.Web, Version=4.0.0.0, Culture=neutral, &#xD;&#xA;         PublicKeyToken=b03f5f7f11d50a3a" />
    </handlers>
  </system.webServer>
</configuration>

这是我的app.config文件:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <startup>
        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
    </startup>
    <system.serviceModel>
      <bindings>
        <webHttpBinding>
          <binding name="webHttpBinding" closeTimeout="00:10:00"
          openTimeout="00:10:00" receiveTimeout="00:10:00" sendTimeout="00:10:00"
          maxBufferSize="2147483647" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647"
          transferMode="Streamed">
            <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647"
              maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
          </binding>
        </webHttpBinding>
      </bindings>
        <client>
            <endpoint address="http://blah/MyService.svc"
                binding="webHttpBinding" bindingConfiguration="webHttpBinding"
                contract="MyService.IMyFunctions" name="webHttpBinding" behaviorConfiguration="webhttp" />
        </client>
      <behaviors>
        <endpointBehaviors>
          <behavior name="webhttp">
            <webHttp/>
          </behavior>
        </endpointBehaviors>
      </behaviors>
    </system.serviceModel>
</configuration>
除了请求太大之外,每一个工作都有效,我不能为我的生活决定出了什么问题。我已经通过堆栈交换中的每一个请求帮助,似乎没有任何区别。我做错了什么?

0 个答案:

没有答案