WCF 暴露元数据的配置

<? xml   version = "1.0"   encoding = "utf-8"   ?>
< configuration >
   < system.servicemodel >
     < services >
       < service   name = "EssentialWCF.StockService"   behaviorConfiguration = "myServiceBehavior" >
         < host >
           < baseaddresses >
             < add   baseaddress = "http://localhost:8000/EssentialWCF"   />
           </ baseaddresses >
         </ host >
         < endpoint   address = ""   binding = "basicHttpBinding"   contract = "EssentialWCF.IStockService"   />
         < endpoint   address = "mex"   binding = "mexHttpBinding"   contract = "IMetadataExchange"   />
       </ service >
     </ services >
     < behaviors >
       < serviceBehaviors >
         < behavior   name = "myServiceBehavior" >
           < serviceMetadata   httpGetEnabled = "True"   />
         </ behavior >
       </ serviceBehaviors >
     </ behaviors >
   </ system.servicemodel >
</ configuration >

你可能感兴趣的:(WCF)