WCF的行为与异常-------配置文件说明

ServiceBehavior and OperationBehavior(这些都是应用在实现类上)

http://msdn.microsoft.com/zh-cn/library/system.servicemodel.servicebehaviorattribute(v=vs.100).aspx

http://msdn.microsoft.com/zh-cn/ms576447.aspx

要求知道的有如下

 ServiceBehavior

}AutomaticSessionShutdown
}ConcurrencyMode
}IgnoreExtensionDataObject
}IncludeExceptionDetaillnFaults
}InstanceContextMode
}ReleaseServiceInstanceOnTransactionComplete
}TransactionAutoCompleteOnSessionClose
}TransactionlsolationLevel
}TtansactionTimeout
 
OperationBehavior
 
}AutoDisposeParameters
}ReleaseInstanceMode
}TransactionAutoComplete
 
 
 <system.serviceModel>
    <services>
      <service name="HCC.Syn.Services.Service1">
        <host>
          <baseAddresses>
            <add baseAddress = "http://localhost:8732/Design_Time_Addresses/HCC.Syn.Services/Service1/" />
          </baseAddresses>
        </host>
        <!-- Service Endpoints -->
        <!-- 除非完全限定,否则地址将与上面提供的基址相关 -->
        <endpoint address ="" binding="wsHttpBinding" contract="HCC.Syn.Services.IService1">
          <!--
              部署时,应删除或替换下列标识元素,以反映
             用来运行所部署服务的标识。删除之后,WCF 将
              自动推断相应标识。
          -->
          <identity>
            <dns value="localhost"/>
          </identity>
        </endpoint>
        <!-- Metadata Endpoints -->
        <!-- 元数据交换终结点供相应的服务用于向客户端做自我介绍。 -->
        <!-- 此终结点不使用安全绑定,应在部署前确保其安全或将其删除-->
        <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
      </service>
    </services>
    <behaviors>
      <serviceBehaviors>
        <behavior name="HCC.Syn.Services.Service1">
          <serviceAuthorization></serviceAuthorization>
          <serviceTimeouts/>
          <serviceThrottling/><!--节流-->
          <!--并发调用的数量/并发实例的个数/这个服务有多少个会话(多少个连接客户端)-->
          <serviceThrottling maxConcurrentCalls="" maxConcurrentInstances="" maxConcurrentSessions=""/>
         
          <!-- 为避免泄漏元数据信息,
          请在部署前将以下值设置为 false 并删除上面的元数据终结点  -->
          <serviceMetadata httpGetEnabled="True"/>
          <!-- 要接收故障异常详细信息以进行调试,
          请将以下值设置为 true。在部署前设置为 false
            以避免泄漏异常信息-->
          <serviceDebug includeExceptionDetailInFaults="False" />
        </behavior>
      </serviceBehaviors>
    </behaviors>
  </system.serviceModel>

posted on 2013-12-01 22:09  peter.peng  阅读(210)  评论(0编辑  收藏  举报