代码之家  ›  专栏  ›  技术社区  ›  Brian Low

WCF ReliableMessaging方法调用了两次

  •  0
  • Brian Low  · 技术社区  · 16 年前

    使用 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>
    

    谢谢,

    布瑞恩

    1 回复  |  直到 16 年前
        1
  •  0
  •   Brian Low    16 年前

    这是由于重新尝试可靠的消息传递造成的。消息处理和传输耗时超过2秒。

    推荐文章