单个服务调用中的多个相同HTTP请求

时间:2018-01-24 07:54:15

标签: wcf wcf-binding

我在IIS 7.5上托管了WCF服务,通过HTTP协议进行通信。它被定义为customBinding,见下文。它需要会话,它还没有保护级别。

<customBinding>
    <binding name="customHttpBinding" openTimeout="00:15:00" sendTimeout="00:15:00" receiveTimeout="00:15:00" closeTimeout="00:15:00">
      <reliableSession ordered="false" />
      <security requireSignatureConfirmation="false"  enableUnsecuredResponse="true" />
      <textMessageEncoding messageVersion="Soap12WSAddressingAugust2004" />
      <httpTransport maxBufferSize="2147483647" maxReceivedMessageSize="2147483647" />
    </binding>
</customBinding>

客户端是MS Excel AddIn,用户的目的是异步调用6个不同的操作契约。在我打开小提琴手之前,一切都很有效。在那里,我看到多个相同的HTTP请求:

enter image description here

我浏览了这些相同响应的内容,它确实包含相同的数据。在调试模式下,我确保客户端只调用一次操作契约,服务方法也只运行一次。

问题是如何减少多个请求?

在过去,我将其配置为wsHttpBinding并且数据未被多次请求,但我们需要对配置进行更多控制,因为它将部署在多个服务器上。

我不想在网络上多次传输相同的数据,在其他情况下我需要传输更大的数据(大约数百MB)。

更新

根据spodger问题,这是客户端配置:

<customBinding>
    <binding name="customHttpBinding" openTimeout="00:15:00" sendTimeout="00:15:00" receiveTimeout="00:15:00" closeTimeout="00:15:00">
    <reliableSession ordered="false" acknowledgementInterval="00:00:30" inactivityTimeout="00:15:00" flowControlEnabled="true" />
      <security requireSignatureConfirmation="false"  enableUnsecuredResponse="true"   />
      <textMessageEncoding messageVersion="Soap12WSAddressingAugust2004"  />
      <httpTransport maxBufferSize="2147483647" maxReceivedMessageSize="2147483647" requestInitializationTimeout="00:10:00" />
    </binding>
  </customBinding>

0 个答案:

没有答案
相关问题