簡體   English   中英

將大量JSON數據發布到WCF服務

[英]Post Large amount of JSON data to WCF Service

我正在使用.NET WCF服務,它從另一個.NET應用程序接受JSON數據作為HTTP Post。

當我發布少量數據時,一切正常(〜高達65kb的數據)

但是當我嘗試發布更多內容時,我在服務端出現內部服務器錯誤。

一切都指向服務僅限於接受高達65kb的數據。

我已閱讀有關修改我的配置文件以接受更多數據與maxrequestmessagesize屬性,但我的問題是我的web.config沒有任何我能看到的綁定。

這是我的配置文件中與服務相關的內容

<system.serviceModel>

    <behaviors>

      <serviceBehaviors>
        <behavior>
          <!-- 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>
    <serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
  </system.serviceModel>

我不知道該怎么做以超過65 k的限制 - 任何幫助將不勝感激。

謝謝

在配置中使用此選項:

<system.serviceModel>
    <bindings>
        <basicHttpBinding>
            <binding name="BasicHttpBinding_ImyService"
                maxBufferPoolSize="2147483647"
                maxReceivedMessageSize="2147483647">
            </binding>
        </basicHttpBinding>
    </bindings>

</system.serviceModel>

我只是快速瀏覽一下,我在不同的地方有4個設置為我的WCF服務“提高請求大小欄”:

maxarraylength(binding / readerquotas tag)maxbuffersize(binding tag)maxreceivedmessagesize(binding tag)maxrequestlength(system.web / httpruntime tag)

我不確定為什么配置中沒有綁定。 也許如果沒有指定,那么使用默認值? 你有任何服務/服務/端點標簽嗎? 也許你是通過代碼設置這些?

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM