Friday, 28 August 2015

App Config structure in WCF


Below Nodes are there in WCF basic bidning
  1. Configuration 
  2. System.ServiceModel
  3.  Services 
  4. Service =>  Name, Behavior Configuration 
  5. endpoint => address, binding , contract 
  6. host => base address 
  7. behaviors => Service behaviors  



<configuration>
     <system.serviceModel>
         <services>
             <service name="WcfCustomerService.CustomerService"
               behaviorConfiguration = "CustomerServiceMEXBehavior" >
                 <endpoint address =""
               binding="basicHttpBinding"
               contract="WcfCustomerService.ICustomerService"/>

                 <endpoint address ="net.tcp://localhost:8090/CustomerService"
                 binding="netTcpBinding"
                 contract="WcfCustomerService.ICustomerService"/>

                 <host>
                     <baseAddresses>
                         <add baseAddress ="http://localhost:8081/CustomerService"/>
                         <add baseAddress ="net.tcp://localhost:8090/CustomerService"/>
                     </baseAddresses>
                 </host>
             </service>
         </services>
         <behaviors>
                 <serviceBehaviors>
                     <behavior name="CustomerServiceMEXBehavior" >
                         <serviceMetadata httpGetEnabled="true" />
                     </behavior>
                 </serviceBehaviors>
             </behaviors>
     </system.serviceModel>
 </configuration  >

No comments:

Post a Comment