我使用一個jQuery/JavaScript客戶端AJAX中的請求,WCF REST服務(webHttpEndpoint),我收到以下異常發送...Javascript來WCF - MaxStringContentLength異常
System.Xml.XmlException:在在讀取XML數據時超出了最大字符串內容長度限額(8192)。可以通過更改創建XML閱讀器時使用的XmlDictionaryReaderQuotas對象上的MaxStringContentLength屬性來增加此配額。
這裏是我的system.serviceModel web.config中定義...
<system.serviceModel>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true"
multipleSiteBindingsEnabled="true" />
<bindings>
<basicHttpBinding>
<binding name="MembershipBinding">
<security mode="TransportWithMessageCredential">
<message clientCredentialType="UserName" />
</security>
</binding>
<binding name="userHttps">
<security mode="Transport" />
</binding>
</basicHttpBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior name="CommonSvcBehavior">
<serviceCredentials>
<userNameAuthentication userNamePasswordValidationMode="MembershipProvider"
membershipProviderName="AspNetSqlMembershipProvider" />
</serviceCredentials>
<serviceAuthorization principalPermissionMode="UseAspNetRoles"
roleProviderName="MySqlRoleProvider" />
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="true" />
</behavior>
<behavior name="AuthenticationServiceTypeBehaviors">
<serviceMetadata httpGetEnabled="true" />
</behavior>
<behavior name="">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="false" />
</behavior>
</serviceBehaviors>
</behaviors>
<standardEndpoints>
<webHttpEndpoint>
<standardEndpoint name=""
crossDomainScriptAccessEnabled="false"
helpEnabled="true"
automaticFormatSelectionEnabled="true" />
</webHttpEndpoint>
</standardEndpoints>
</system.serviceModel>
我已經嘗試添加以下綁定.....但它不生效?
<webHttpBinding>
<binding name="webHttpBindingDev">
<readerQuotas maxDepth="2147483647"
maxStringContentLength="2147483647"
maxArrayLength="2147483647"
maxBytesPerRead="2147483647"
maxNameTableCharCount="2147483647" />
</binding>
</webHttpBinding>
你能幫忙嗎?
十個問題,沒有一個公認的答案? – 2012-02-10 03:57:47