2013-02-19 55 views
1

我正在使用.NET WCF服務,該服務從另一個.NET應用程序接受JSON數據作爲HTTP Post。將大量JSON數據發佈到WCF服務

當我發佈一個數據量小的一切工作正常(〜可達數據的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金的限制做的 - 任何幫助,將不勝感激。

感謝

回答

2

使用這個在你的配置:

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

</system.serviceModel> 
1

我剛剛看了一下,我在不同的地方4名設置爲「提升請求大小欄」我的WCF服務:

的MaxArrayLength(綁定/ readerquotas標籤) MAXBUFFERSIZE(結合標籤) maxreceivedmessagesize(綁定標記) 的maxRequestLength(System.Web程序/的httpRuntime標籤)

我不知道爲什麼會出現在你的配置不綁定。也許如果沒有指定,那麼使用默認值?你有任何服務/服務/端點標籤?也許你正在通過代碼設置這些?