C&C++   发布时间:2022-04-03  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了WCF启动花费了太多时间大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
在所有呼叫执行非常快之后,WCF服务在第一次请求时大约需要5-6秒.
下面是我的WCF服务的客户端配置. @H_403_8@

@H_403_8@使用IIS主机.

@H_403_8@

WShttpBinding binding = new WShttpBinding();
        binding.SendTimeout = TimeSpan.Fromminutes(1);
        binding.openTimeout = TimeSpan.Fromminutes(1);
        binding.CloseTimeout = TimeSpan.Fromminutes(1);
        binding.ReceiveTimeout = TimeSpan.Fromminutes(1);
        binding.AllowCookies = false;
        binding.bypassProxyOnLocal = false;
        binding.HostNameComparisonMode = HostNameComparisonMode.StrongWildcard;

        binding.messageEncoding = WSmessageEncoding.Mtom; 

        binding.TextEncoding = System.Text.Encoding.UTF8;
        binding.UseDefaultWebProxy = true;
        binding.Name = "BasichttpBinding_ILearningservice";


        binding.Security.Mode = S@L_682_4@mode.Transport;              
        binding.Security.Transport.ClientCredentialType = httpClientCredentialType.None;
        binding.Security.Transport.ProxyCredentialType = httpProxyCredentialType.None;
        binding.Security.Transport.Realm = "";
@H_403_8@服务器端配置

@H_403_8@

<services>
  <service behaviorConfiguration="LearningserviceserviceBehavior" name="Learningservice">
    <host>

      <baseAddresses>
        <add baseAddress="https://xxxxx/Learningservice.svc" />
      </baseAddresses>
    </host>
    <endpoint address="" binding="wshttpBinding" bindingConfiguration="TransportSecurity" contract="ILearningSuiteservice">
      <identity>
        <dns value="localhost" />
      </identity>
     </endpoint>

    <endpoint address="mex" binding="mexhttpsBinding" contract="IMetadataExchange" />
  </service>
</services>
<bindings>
  <wshttpBinding>
    <binding name="TransportSecurity" messageEncoding="Mtom" sendTimeout="00:1:00" openTimeout="00:2:00">
      <security mode="Transport">
        <transport clientCredentialType="None" />
      </security>
    </binding>
  </wshttpBinding>
</bindings>
<behaviors>
  <serviceBehaviors>
    <behavior name="LearningserviceserviceBehavior">
      <serviceMetadata httpsGetEnabled="true" httpGetEnabled="false" httpGetUrl="http://xxxxxxx/Metadata" httpsGetUrl="https://xxxxxxxx/Metadata" />
      <serviceDebug includeExceptionDetailInFaults="true" />
    </behavior>
  </serviceBehaviors>
</behaviors>

@L_801_21@

您可能会看到的另一个问题是,当您使用传输安全性时,每次创建新代理时都会在客户端上进行证书验证.例如,由于证书的撤销列表无法及时提供,证书验证是否可能很昂贵? @H_403_8@

@H_403_8@尝试关闭安全性,看看是否会改变行为

大佬总结

以上是大佬教程为你收集整理的WCF启动花费了太多时间全部内容,希望文章能够帮你解决WCF启动花费了太多时间所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。