我正在使用JavaScript代码访问WCF服务。
<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>
现在的问题是当我传递一个大块的字符串值时,我会收到一个异常。
内部接收信息是 类型系统标的脱轨有误。 努力。 在阅读XML数据时,最高限值(8192)已超出。
我如何使用JavaScript设置MaxStringContentLength值?
任何建议?
Thanks -Aruna