zoukankan      html  css  js  c++  java
  • 关于wcf跨机器访问的问题

    在wcf跨机器的访问中遇到了各种无法访问的问题,本人也是在通过个人解决问题的基础上发表一下自己的经验,如果还有其他方面可能影响wcf跨机器的问题,还希望大家多多发言!

    好了废话不多说了,正文如下:

    1、设置好wcf的服务端security mode要设置为None,如

     <services>
          <service behaviorConfiguration="metadataBehavior" name="Services.CalculatorService">
            <endpoint address="http://192.168.1.108:9999/calculatorservice" binding="wsHttpBinding"
                bindingConfiguration="NoneSecurity" contract="Contracts.ICalculator"  />
          </service>
        </services>
        <bindings>
          <wsHttpBinding>
            <binding name="NoneSecurity">
              <!--maxBufferPoolSize="12000000" maxReceivedMessageSize="12000000" useDefaultWebProxy="false">
              <readerQuotas maxStringContentLength="12000000" maxArrayLength="12000000"/>-->
              <security mode="None"/>
            </binding>
          </wsHttpBinding>
        </bindings>

    这里要注意的是bindingConfiguration="NoneSecurity",<binding name="NoneSecurity">,<security mode="None"/>这三个地方,一定要设好。

    然后是客户端中的security mode的设置,如

    <binding name="WSHttpBinding_CalculatorService" closeTimeout="00:01:00"
                       openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
                       bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard"
                       maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
                       messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true"
                       allowCookies="false">
              <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
                  maxBytesPerRead="4096" maxNameTableCharCount="16384" />
              <reliableSession ordered="true" inactivityTimeout="00:10:00"
                  enabled="false" />
              <security mode="None">
                <transport clientCredentialType="Windows" proxyCredentialType="None" realm="" />
                <message clientCredentialType="Windows" negotiateServiceCredential="true" />
              </security>
            </binding>

    这里要注意的是<security mode="None">这里也要设置为None,这样在程序运行的时候才不会粗;

    最后就是一定要注意把服务端的防火墙关掉,不然也无法卡机器访问,好了就这些,如果还有新的可能导致该问题的情况,还请大家发言!

  • 相关阅读:
    关于 语文物理 和 数学物理
    黎耀天 共量子 我拍了 几张照片 给你们 当 素材
    看了 陈记抄 同学 的 《随便聊聊之量子力学中的散射理论》
    极坐标系 下的 牛顿第二定律
    jQuery 工具类库集锦
    Javascript跨域问题解决方案
    js禁止从浏览器缓存读取消息
    关于双击事件.MouseEvent.DOUBLE_CLICK
    div的打开与关闭js
    利用通道完成文件的复制 (非直接缓存区)
  • 原文地址:https://www.cnblogs.com/sysmenu/p/3621417.html
Copyright © 2011-2022 走看看