zoukankan      html  css  js  c++  java
  • WCF配置文件结构

    WCF配置文件结构:

    <system.serviceModel>
      
    <!--服务器端WCF服务配置-->
        
    <services>
          
    <!--使用配置文件启动元数据交换行为,这样就可以在浏览器中通过配置的地址进行访问-->
          
    <service behaviorConfiguration="TestBehavior" name="NameSpace.TestClass">
            
    <!--
            终结点:终结点由地址、绑定、契约有关,地址定义了服务的位置,绑定定义了服务通信的方式,契约定义了服务的内容
            address为空则表示使用基地址
            使用配置文件可以为终结点使用的绑定进行定制,即添加 bindingConfiguration 属性,它的值应与<bindings>配置节中定制的绑定名一致
            
    -->
            
    <endpoint address="" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_ITest" contract="NameSpace.ITestInterface">
              
    <identity>
                
    <!--只允许本地调用-->
                
    <dns value="localhost"/>
              
    </identity>
            
    </endpoint>
            
    <!--元数据交换-->
            
    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
          
    </service>
        
    </services>
      
      
    <!--元数据交换行为配置-->
        
    <behaviors>
          
    <serviceBehaviors>
            
    <behavior name="TestBehavior">
              
    <!--基于HTTP-GET的元数据交换-->
              
    <serviceMetadata httpGetEnabled="true"/>
              
    <!--显示详细的异常信息-->
              
    <serviceDebug includeExceptionDetailInFaults="true"/>
            
    </behavior>
          
    </serviceBehaviors>
        
    </behaviors>
      
      
    <!--定制绑定-->
        
    <bindings>
          
    <basicHttpBinding>
            
    <binding name="BasicHttpBinding_ITest" messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered" useDefaultWebProxy="true">
              
    <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384"/>
              
    <security mode="None">
                
    <transport clientCredentialType="None" proxyCredentialType="None" realm=""/>
                
    <message clientCredentialType="UserName" algorithmSuite="Default"/>
              
    </security>
            
    </binding>
          
    </basicHttpBinding>
        
    </bindings>
    </system.serviceModel>
  • 相关阅读:
    “敏捷版”全链路压测
    不改一行代码,轻松拥有企业级微服务治理|MSE微服务治理专业版重磅发布
    和 VMware、深信服、天翼云、招商云专家一起聊聊云原生边缘计算
    阿里大规模业务混部下的全链路资源隔离技术演进
    Serverless 下的微服务实践
    阿里云发布云原生加速器,携手生态企业拥抱数字时代
    LifseaOS 悄然来袭,一款为云原生而生的 OS
    12.04 深圳站 | Serverless Developer Meetup 开放报名啦!
    Kubernetes 已经成为云原生时代的安卓,这就够了吗?
    阿里云发布云原生加速器,携手生态企业拥抱数字时代
  • 原文地址:https://www.cnblogs.com/artwl/p/1965779.html
Copyright © 2011-2022 走看看