使用Fiddler,我们会在以下情况下为每个调用看到3 个 HTTP 请求(和匹配的响应):
- WS-ReliableMessaging 已启用,并且,
- 该方法返回大量数据(17MB)
第一个 HTTP 请求是带有“CreateSequence”操作的 SOAP 消息(假定建立可靠会话)。第二个和第三个 HTTP 请求是调用我们的 webservice 方法的相同 SOAP 消息。为什么会有两条相同的消息?
这是我们的配置:
<system.serviceModel>
<client>
<endpoint address="http://server/vdir/AccountingService.svc"
binding="wsHttpBinding"
bindingConfiguration="customWsHttpBinding"
behaviorConfiguration="LargeServiceBehavior"
contract="MyProject.Accounting.IAccountingService"
name="BasicHttpBinding_IAccountingService" />
</client>
<bindings>
<wsHttpBinding>
<binding name="customWsHttpBinding" maxReceivedMessageSize="90000000">
<reliableSession enabled="true"/>
<security mode="None" />
</binding>
</wsHttpBinding>
</bindings>
<behaviors>
<endpointBehaviors>
<behavior name="LargeServiceBehavior">
<dataContractSerializer maxItemsInObjectGraph="2147483647"/>
</behavior>
</endpointBehaviors>
</behaviors>
</system.serviceModel>
谢谢,
布赖恩