为了测试,我有一个小的自主Web服务,它返回提交字符串的长度。
对于字符串短或等于32767,它可以正常工作但是字符串被切掉了。 我正在使用WCFtestclient进行测试,并调整了客户端配置中的缓冲区。但它似乎被忽略了。使用IIS托管服务找到了大量样本,这些服务只是增加了缓冲区,而且似乎可以正常工作。在自主设备中似乎没有。
这是我的app.config:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="NewBinding0" maxBufferPoolSize="2147483647" maxBufferSize="2147483647"
maxReceivedMessageSize="2147483647" transferMode="Buffered"
messageEncoding="Text">
<readerQuotas maxDepth="2147483647"
maxStringContentLength="2147483647"
maxArrayLength="2147483647"
maxBytesPerRead="2147483647"
maxNameTableCharCount="2147483647"/>
</binding>
</basicHttpBinding>
</bindings>
<client>
<endpoint address="http://CELSIUS:8080/RWService/RWService.svc"
binding="basicHttpBinding" bindingConfiguration="NewBinding0"
contract="RWOrderServiceWCF.IRWWCFService" name="testclient"
kind="" endpointConfiguration="">
<identity>
<certificateReference storeName="My" storeLocation="LocalMachine"
x509FindType="FindBySubjectDistinguishedName" />
</identity>
</endpoint>
</client>
<behaviors>
<serviceBehaviors>
<behavior name="NewBehavior0">
<serviceMetadata httpGetEnabled="true" />
</behavior>
</serviceBehaviors>
</behaviors>
<services>
<service behaviorConfiguration="NewBehavior0" name="RWOrderServiceWCF.RWWCFService">
<endpoint address="RWService.svc" binding="basicHttpContextBinding"
bindingConfiguration="" contract="RWOrderServiceWCF.IRWWCFService"
isSystemEndpoint="false" />
<host>
<baseAddresses>
<add baseAddress="http://CELSIUS:8080/RWService" />
</baseAddresses>
</host>
</service>
</services>
</system.serviceModel>
</configuration>