0
我訪問使用JavaScript代碼WFC + JavaScript的MaxStringContentLength問題
<asp:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering="true">
<Services>
<asp:ServiceReference Path="ForumService.svc" />
</Services>
</asp:ScriptManager>
在web.config中
<system.serviceModel>
<diagnostics>
<messageLogging logMalformedMessages="true" logMessagesAtTransportLevel="true" />
</diagnostics>
<serviceHostingEnvironment />
<bindings>
<wsHttpBinding>
<binding name="WSHttpBinding_ITranscriptService" closeTimeout="00:10:00" openTimeout="00:10:00" receiveTimeout="00:10:00" sendTimeout="00:10:00" bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="524288" maxReceivedMessageSize="2147483647" messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true" allowCookies="false">
<readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647"/>
<reliableSession ordered="true" inactivityTimeout="00:10:00" enabled="false"/>
<security mode="Message">
<transport clientCredentialType="Windows" proxyCredentialType="None" realm=""/>
<message clientCredentialType="Windows" negotiateServiceCredential="true" algorithmSuite="Default" establishSecurityContext="true"/>
</security>
</binding>
</wsHttpBinding>
</bindings>
<client>
<endpoint address="http://localhost:10780/TranscriptService.svc" binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_ITranscriptService" contract="TVServiceReference.ITranscriptService" name="WSHttpBinding_ITranscriptService">
<identity>
<dns value="localhost"/>
</identity>
</endpoint>
</client>
<behaviors>
<endpointBehaviors>
<behavior name="WebTV.ForumServiceAspNetAjaxBehavior">
<enableWebScript />
</behavior>
</endpointBehaviors>
<serviceBehaviors>
<behavior name="WebTV.TranscriptServiceBehavior" >
<serviceMetadata httpGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="true"/>
</behavior>
</serviceBehaviors>
</behaviors>
<services>
<service behaviorConfiguration="WebTV.TranscriptServiceBehavior"
name="WebTV.TranscriptService">
<endpoint address="" binding="wsHttpBinding" contract="WebTV.ITranscriptService">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
</service>
<service behaviorConfiguration="WebTV.TranscriptServiceBehavior" name="WebTV.ForumService">
<endpoint address="" behaviorConfiguration="WebTV.ForumServiceAspNetAjaxBehavior"
binding="webHttpBinding" contract="WebTV.ForumService" />
</service>
</services>
</system.serviceModel>
現在的問題是,當我經過一大塊字符串值的WCF服務,我收到異常
設置InnerException消息是「有反序列化System.String類型的對象錯誤。讀取XML數據時,超過了最大字符串內容長度限額(8192)。
如何設置MaxStringContentLength值這個使用JavaScript?
有什麼建議嗎?
感謝 -Aruna