【发布时间】:2011-01-19 03:14:08
【问题描述】:
我正在尝试解决 WCF 错误 found in my previous question。基本上,错误是:
读取 XML 数据时已超出最大字符串内容长度配额 (8192)。
有人建议在我的 web.config 中使用 services 标签来解决我的问题。
现在,我面临一个不同的问题。我不知道我应该如何在我的 web.config 中配置 services 标记以在我的服务器上正常工作。当我尝试使用 services 标签时,我总是收到以下错误:
服务器没有提供有意义的回复;这可能是由于合同不匹配、会话过早关闭或内部服务器错误造成的。
这是我添加了 services 标签的 web.config:
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding
name="BasicHttpBinding_Service1"
closeTimeout="00:01:00"
openTimeout="00:01:00"
receiveTimeout="00:10:00"
sendTimeout="00:01:00"
allowCookies="false"
bypassProxyOnLocal="false"
hostNameComparisonMode="StrongWildcard"
maxBufferSize="65536"
maxBufferPoolSize="524288"
maxReceivedMessageSize="65536"
messageEncoding="Text"
textEncoding="utf-8"
transferMode="Buffered"
useDefaultWebProxy="true">
<readerQuotas
maxDepth="32"
maxStringContentLength="10000"
maxArrayLength="16384"
maxBytesPerRead="4096"
maxNameTableCharCount="16384" />
<security mode="None">
<transport clientCredentialType="None" proxyCredentialType="None"
realm="" />
<message clientCredentialType="UserName" algorithmSuite="Default" />
</security>
</binding>
</basicHttpBinding>
</bindings>
<client>
<endpoint
address="http://localhost:53931/WCF/Service1.svc"
binding="basicHttpBinding"
bindingConfiguration="BasicHttpBinding_Service1"
contract="ServiceReference.Service1"
name="BasicHttpBinding_Service1" />
</client>
<behaviors>
<serviceBehaviors>
<behavior name="">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="false" />
</behavior>
</serviceBehaviors>
</behaviors>
<!--PROBLEM SOMEWHERE IN THE SERVICES TAG-->
<services>
<service
behaviorConfiguration="NewBehavior"
name="AspPersonalWebsite.ServiceReference">
<endpoint
address="http://localhost:53931/WCF/Service1.svc"
binding="basicHttpBinding"
contract="ServiceReference.Service1"
bindingConfiguration="BasicHttpBinding_Service1" />
</service>
</services>
请注意,删除 services 标记后一切正常,但我将无法解决我在previous question 上发布的原始问题。
如果我在 web.config 上做错了,特别是在我的 services 标签中,有人可以告诉我吗?!
【问题讨论】:
-
嗯,问题真的是:IS这真的是您在此处配置的服务吗?我的意思是服务的服务器端,服务代码存在和执行的地方??
标签: wcf web-config