2014-05-07 64 views
1

問題:已超出傳入郵件的最大郵件大小限額(65536)。要增加配額,請在相應的綁定元素上使用MaxReceivedMessageSize屬性。配置文件詳細信息。如何在超過(65536)時增加WCF服務的傳入郵件的最大郵件大小限額

<services> 
    <service behaviorConfiguration="WCFServiceBehavior" 
      name="GenServiceLibrary.IFileUploadService"> 
    <endpoint address="FileUploadService.svc" binding="basicHttpBinding" 
       behaviorConfiguration="CoreServiceBehavior" 
       bindingConfiguration="WCFServiceBinding" 
       contract="GenServiceLibrary.IFileUploadService"/> 
    <endpoint address="mex" binding="mexHttpsBinding" 
       contract="IMetadataExchange"/> 
    </service> 
    <service behaviorConfiguration="WCFServiceBehavior" 
      name="GenServiceLibrary.Service.svc"> 
    <endpoint address="Service.svc" binding="basicHttpBinding" 
       behaviorConfiguration="CoreServiceBehavior" 
       bindingConfiguration="WCFServiceBinding" 
       contract="GenServiceLibrary.ICommonService"/> 
    <endpoint address="mex" binding="mexHttpsBinding" 
       contract="IMetadataExchange"/> 
    </service> 
</services> 
<bindings> 
    <basicHttpBinding> 
    <binding name="WCFServiceBinding" maxBufferPoolSize="1024000" 
      maxBufferSize="1024000" maxReceivedMessageSize="1024000"> 
     <readerQuotas maxDepth="1024000" maxStringContentLength="1024000" 
        maxArrayLength="1024000" maxBytesPerRead="1024000" 
        maxNameTableCharCount="1024000" /> 
    </binding> 
    </basicHttpBinding> 
</bindings> 
<behaviors> 
    <serviceBehaviors> 
    <behavior name="WCFServiceBehavior"> 
     <serviceMetadata httpsGetEnabled="true" /> 
     <serviceDebug includeExceptionDetailInFaults="true" /> 
    </behavior> 
    </serviceBehaviors> 
    <endpointBehaviors> 
    <behavior name="CoreServiceBehavior"> 
     <webHttp /> 
    </behavior> 
    </endpointBehaviors> 
</behaviors> 

回答

3

很難解讀你的問題真正來自你發佈的信息。

爲了使用WCF傳輸大型郵件,需要確保在客戶端和服務器配置文件中增加郵件配額值以解決問題。否則,分辨率相對簡單,只需調整配置以獲得更高的值即可。

例如:

<binding name="DefaultBasicHttpBinding" maxBufferPoolSize="1024000" maxBufferSize="1024000" maxReceivedMessageSize="1024000"> 
    <readerQuotas maxDepth="1024000" maxStringContentLength="1024000" maxArrayLength="1024000" maxBytesPerRead="1024000" maxNameTableCharCount="1024000" /> 
</binding> 
+0

感謝,我想上面的,但不是爲我工作。 –

+0

在客戶端和服務器配置中,值是否都增加了? – Seymour

+0

感謝Seymour.yes,但是當iam僅在服務器內部使用服務時發生。 –

相關問題