2011-10-17 105 views
2

我有一個在另一個項目中調用WCF服務的silverlight應用程序(相同的解決方案) 問題是我得到所有常見錯誤65536 我已閱讀噸的文章,我已經試過一切仍然得到這個消息。傳入郵件的最大郵件大小限額(65536)已被超出

這裏是我的Web服務

<system.web> 
    <compilation debug="true" strict="false" explicit="true" targetFramework="4.0" /> 
    <httpRuntime maxRequestLength="2147483647"/> 
    <customErrors mode="Off"/> 
</system.web> 
<system.serviceModel> 
    <services> 
    <service behaviorConfiguration="ServiceBehavior" name="MyRemoteHostService"> 
     <endpoint address="" binding="basicHttpBinding" 
       bindingConfiguration="BasicHttpBinding_MyRemoteHostService" 
       contract="MyServiceReference.MyRemoteHostService" /> 

     <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" /> 
    </service> 
    </services> 
    <serviceHostingEnvironment aspNetCompatibilityEnabled="false" 
          multipleSiteBindingsEnabled="true" /> 
    <bindings> 
    <basicHttpBinding> 
     <binding name="BasicHttpBinding_MyRemoteHostService" 
       maxBufferPoolSize="2147483647" 
       maxReceivedMessageSize="2147483647" 
       maxBufferSize="2147483647"> 
     <readerQuotas maxArrayLength="2147483647" 
         maxBytesPerRead="2147483647" 
         maxDepth="2147483647" 
         maxNameTableCharCount="2147483647" 
         maxStringContentLength="2147483647" /> 
     </binding> 
    </basicHttpBinding> 
    </bindings> 
    <behaviors> 
    <serviceBehaviors> 
     <behavior name="ServiceBehavior"> 
     <serviceMetadata httpGetEnabled="true" /> 
     <serviceDebug includeExceptionDetailInFaults="false" /> 
     <dataContractSerializer maxItemsInObjectGraph="2147483647" /> 
     </behavior> 
    </serviceBehaviors> 
    </behaviors> 
</system.serviceModel> 
<system.webServer> 
    <modules runAllManagedModulesForAllRequests="true"/> 
</system.webServer> 

,這裏是我的客戶端ServiceReferences.ClientConfig

<system.web> 
    <compilation debug="true" strict="false" explicit="true" targetFramework="4.0" /> 
    <httpRuntime maxRequestLength="2147483647"/> 
    <customErrors mode="Off"/> 
</system.web> 
<system.serviceModel> 
    <bindings> 
    <basicHttpBinding> 
     <binding name="BasicHttpBinding_MyRemoteHostService" 
       closeTimeout="00:01:00" 
       openTimeout="00:01:00" 
       receiveTimeout="00:05:00" 
       sendTimeout="00:02:00" 
       maxBufferSize="2147483647" 
       maxReceivedMessageSize="2147483647"> 
     <security mode="None"></security> 
     </binding> 
    </basicHttpBinding> 
    </bindings> 
    <client> 
    <endpoint address="http://localhost:2622/MyRemoteHostService.svc" 
       binding="basicHttpBinding" 
       bindingConfiguration="BasicHttpBinding_MyRemoteHostService" 
       contract="MyServiceReference.MyRemoteHostService" 
       name="BasicHttpBinding_MyRemoteHostService" /> 
    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" /> 
    </client> 
</system.serviceModel> 
+1

這些問題上必須有** gazillions ** - 你**搜索**之前發佈另一個這些?請搜索!我相信你會發現噸答案! –

+1

重複[傳入郵件的最大郵件大小限額(65536)已被超過](http://stackoverflow.com/questions/7232355/the-maximum-message-size-quota-for-incoming-messages-65536-已經超出)和一個**很多更多的**這些問題在SO ..... –

回答

0

您可以在客戶端配置文件看看。我懷疑這是你的錯誤來自哪裏。

+0

客戶端配置已將所有設置爲2147483647 – user958015

+0

客戶端配置已將所有設置設置爲2147483647 此外,這是通過超過限制,沒有收到......許多說 user958015

+0

Ctrl + Shift + F,查找「65536」,查看整個解決方案。在服務解決方案中重複,如果與客戶端解決方案分開。這個價值必須在某個地方。 – DenaliHardtail

0

試試這個:

<binding name="higherMessageSize" maxReceivedMessageSize="2147483647"> 
    <readerQuotas maxStringContentLength="2147483647" /> 
</binding> 
+0

這是在那裏alredy,無論是maxStringContentLength和maxReceivedMessageSize – user958015

0

我發現的問題;命名空間不是在服務名稱設置

<service behaviorConfiguration="ServiceBehavior" name="MyRemoteHostService"> 

改爲

<service behaviorConfiguration="ServiceBehavior" name="My.Framework.Web.MyRemoteHostService"> 
0

感謝user958015我解決它你做同樣的方式,我din't對Web服務端這部分

<services> 
<service behaviorConfiguration="ServiceBehavior" name="MyRemoteHostService"> 
    <endpoint address="" binding="basicHttpBinding" 
      bindingConfiguration="BasicHttpBinding_MyRemoteHostService" 
      contract="MyServiceReference.MyRemoteHostService" /> 

    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" /> 
</service> 

的「readerQuotas」屬性不Silverlight中存在,你就必須讓蘇因爲你在web服務和客戶端有相同的屬性,並確保在web服務端寫入名稱和命名空間

相關問題