WCF 服务器端App.config 配置

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <system.serviceModel>
    <services>
      <service name="Sercice.Service" behaviorConfiguration="calculatorBehavior" >
        <host>
          <baseAddresses>
            <add baseAddress="http://localhost:8800"/>
          </baseAddresses>
        </host>
        <endpoint address="" binding ="wsHttpBinding" contract="Contract.IService" ></endpoint>
        <endpoint contract="IMetadataExchange" binding="mexHttpBinding" address="mex" />
      </service>
    </services>
    <behaviors>
      <serviceBehaviors>
        <behavior name="calculatorBehavior">
          <serviceMetadata httpGetEnabled="true" />
        </behavior>
        </serviceBehaviors>
    </behaviors>
  </system.serviceModel>
</configuration>

在部署WCF中,会碰到不同计算机无法访问的问题

在<endpoint>加入 bindingConfiguration="NoneSecurity"

在<system.serviceModel>节点中,加入下面代码

    <bindings>
      <wsHttpBinding>
        <binding name="NoneSecurity">
          <security mode="None"/>
        </binding>
      </wsHttpBinding>
    </bindings>

 

posted on 2011-02-22 12:51  缘来  阅读(971)  评论(0)    收藏  举报

导航