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

    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,这样在程序运行的时候才不会粗;

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

     
     
     
    标签: wcfxml
  • 相关阅读:
    jquery 复制粘贴上传图片插件
    chrome插件的开发
    js获取剪切板内容,js控制图片粘贴
    记录前端常用的插件
    如何快速搭建node.js项目,app.js详解
    原型和原型链
    js 上传文件功能
    前端模块化开发发展史
    闭包实例
    5月8日疯狂猜成语-----对孔祥安组的测试版
  • 原文地址:https://www.cnblogs.com/Leo_wl/p/3622064.html
Copyright © 2011-2022 走看看