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>
  • 相关阅读:
    UVA 11925 Generating Permutations 生成排列 (序列)
    UVA 1611 Crane 起重机 (子问题)
    UVA 11572 Unique snowflakes (滑窗)
    UVA 177 PaperFolding 折纸痕 (分形,递归)
    UVA 11491 Erasing and Winning 奖品的价值 (贪心)
    UVA1610 PartyGame 聚会游戏(细节题)
    UVA 1149 Bin Packing 装箱(贪心)
    topcpder SRM 664 div2 A,B,C BearCheats , BearPlays equalPiles , BearSorts (映射)
    UVA 1442 Cave 洞穴 (贪心+扫描)
    UVA 1609 Foul Play 不公平竞赛 (构(luan)造(gao)+递归)
  • 原文地址:https://www.cnblogs.com/artwl/p/1965779.html
Copyright © 2011-2022 走看看