1

wcf は、100 行を超えるデータセットの取得に失敗します。「受信メッセージの最大メッセージ サイズ クォータ (65536) を超えました。クォータを増やすには、適切なバインド要素で MaxReceivedMessageSize プロパティを使用してください。」というメッセージが表示されます。しかし、wcfプロジェクトのweb.config内で、以下に示すようにバインディングを作成しました

<bindings>
  <basicHttpBinding>
    <binding name="basicHttp" allowCookies="true"
             maxReceivedMessageSize="20000000"
             maxBufferSize="20000000"
             maxBufferPoolSize="20000000">
      <readerQuotas maxDepth="32"
           maxArrayLength="200000000"
           maxStringContentLength="200000000"/>
    </binding>
  </basicHttpBinding>
</bindings>
<client>
  <endpoint binding="basicHttpBinding" bindingConfiguration="wsHttpBinding_ILabelService" contract="LabelService.ILabelService" name="BasicHttpBinding_ILabelService"/>
</client>

<services>
  <service name="projectname.Service1"   behaviorConfiguration="projectname.Service1Behavior">
    <!-- Service Endpoints -->
    <endpoint address="" binding="wsHttpBinding"  contract="projectname.IService1">
      <!-- 
          Upon deployment, the following identity element should be removed or replaced to reflect the 
          identity under which the deployed service runs.  If removed, WCF will infer an appropriate identity 
          automatically.
      -->
      <identity>
        <dns value="localhost"/>
      </identity>
    </endpoint>
    <endpoint address="mex" binding="mexHttpBinding"   contract="IMetadataExchange"/>
  </service>
</services>

<behaviors>
  <serviceBehaviors>
    <behavior name="projectname.Service1Behavior">
      <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
      <serviceMetadata httpGetEnabled="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>


助けてください。

4

1 に答える 1

0
<system.serviceModel>
    <bindings>
        <basicHttpBinding>
            <binding name="BasicHttpBinding_ILabelService" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" maxBufferSize="3145728" maxBufferPoolSize="524288" maxReceivedMessageSize="3145728" messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered" useDefaultWebProxy="true">
                <readerQuotas maxDepth="32" maxStringContentLength="3145728" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384"/>
            </binding>
        </basicHttpBinding>
    </bindings>
    <client>
        <endpoint binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_ILabelService" contract="LabelService.ILabelService" name="BasicHttpBinding_ILabelService"/>
    </client>
</system.serviceModel>

編集

エンドポイントをバインディング名に設定する必要があります。設定でこれを試してください。注意:完全な名前空間構造を持つサービス クラス名とバインディング構成を設定する必要 があります。contractbindingConfigurationname

<client>
    <endpoint binding="basicHttpBinding" bindingConfiguration="basicHttp" contract="YourNamespace.YourServiceClassName" name="BasicHttpBinding_ILabelService"/>
</client>
于 2013-03-30T10:42:41.777 に答える