WCF系列(三) -- WCF配置文件注释

2008年10月4日更新

xml version="1.0" encoding="utf-8" ?>

<configuration>

     <system.ServiceModel>

        

         <services>

             

              <service name="名称空间.类型名" behaviorConfiguration="behavior">

                   <host>

                       <baseAddresses>

                           

                            <add baseAddress="http://address" />

                       baseAddresses>

                       <timeouts>timeouts>

                   host>

                  

                   <endpoint address="URI" binding="basicHttpBinding" contract="Contract全限定名" bindingConfiguration="binding" behaviorConfiguration="String" name="">

                      

                       <headers>

                           

                       headers>

                   endpoint>

              service>

         services>

 

         <bindings>

             

              <basicHttpBinding>

                  

                   <binding name="binding">

                   binding>

              basicHttpBinding>

         bindings>

        

         <behaviors>

             

              <serviceBehaviors>

                  

                   <behavior name="Behavior名称">

                      

                       <serviceMetadata httpGetEnabled="true" httpGetUrl="http://URI:port/address" />

                      

                       <serviceCredentials>

                           

                            <serviceCertificate storeName="存储区" storeLocation="存储位置" x509FindType="FindBySubjectName" findValue="server1" />

                       serviceCredentials>

 

                   behavior>

              serviceBehaviors>

             

              <endpointBehaviors>

                  

                   <behavior name="Behavior名称">

                      

                       <clientCredentials>

                           

                            <clientCertificate storeName="存储区" storeLocation="存储位置" x509FindType="FindBySubjectName" findValue="Client1" />

                            <serviceCertificate>

                                 <authentication certificateValidationMode="None" />

                            serviceCertificate>

                       clientCredentials>

                   behavior>

              endpointBehaviors>

         behaviors>

        

         <client>

             

              <endpoint address="URI" binding="basicHttpBinding" bindingConfiguration="binding" behaviorConfiguration="String" contract="Contract全限定名" name="endpoint配置名" >

                  

                   <identity>

                       <userPrincipalName>userPrincipalName>

                       <servicePrincipalName>servicePrincipalName>

                      

                       <dns>dns>

                       <rsa>rsa>

                      

                       <certificate encodedValue="">certificate>

                      

                       <certificateReference storeName="存储区" storeLocation="存储位置" x509FindType="FindBySubjectName" findValue="Client1" />

                   identity>

              endpoint>

         client>

     system.ServiceModel>

configuration>

 

TrackBack:http://www.cnblogs.com/chnking/archive/2008/01/23/1049353.html

转载于:https://www.cnblogs.com/hdjjun/archive/2008/12/30/1365437.html

你可能感兴趣的:(WCF系列(三) -- WCF配置文件注释)