There are two ways to publish service metadata: one is to provide metadata based on the Http-get protocol, which is a simple text-based protocol that is supported by most platforms, and the other is the metadata exchange endpoint.
1. Based on the Http-get protocol
<?xml version= "1.0" encoding= "Utf-8"?><configuration> <system.serviceModel> <services> & Lt;service name= "Hellowcfservice.hellowcfservice" behaviorconfiguration= "Metaexchange" > <servicemetadata httpgetenabled= "true"/><!--<serviceMetadata/>--> </behavior> </serviceBehaviors> </behaviors> </ System.servicemodel></configuration>
2. Metadata Exchange Endpoint
<?xml version= "1.0" encoding= "Utf-8"?><configuration> <system.serviceModel> <services> & Lt;service name= "Hellowcfservice.hellowcfservice" behaviorconfiguration= "Metaexchange" > <endpoint address= "Metaexchange" binding= "mexhttpbinding" contract= "IMetadataExchange"/></service> </services> <behaviors> <serviceBehaviors> <behavior name= "Metaexc Hange "> <!--<servicemetadata httpgetenabled=" true "/>--><serviceMetadata/></behavior> </serviceBehaviors> </behaviors> </system.serviceModel></configuration>
How C # WCF publishes metadata for a service