Structure of the WCF configuration file:
< System. servicemodel >
<! -- Server-side WCF Service Configuration -->
< Services >
<! -- Use the configuration file to start metadata exchange so that you can access -->
< Service Behaviorconfiguration = "Testbehavior" Name = "Namespace. testclass" >
<! --
Endpoint: the endpoint is related to the address, binding, and contract. The address defines the service location, the binding defines the service communication mode, and the contract defines the service content.
If the address is empty, the base address is used.
The configuration file can be used to customize the binding used by the endpoint, that is, to add the bindingconfiguration attribute. Its value should be consistent with the custom binding name in the <bindings> Configuration section.
-->
< Endpoint Address = "" Binding = "Basichttpbinding" Bindingconfiguration = "Basichttpbinding_itest" Contract = "Namespace. itestinterface" >
< Identity >
<! -- Only Local calls are allowed -->
< DNS Value = "Localhost" />
</ Identity >
</ Endpoint >
<! -- Metadata Exchange -->
< Endpoint Address = "Mex" Binding = "Mexhttpbinding" Contract = "Imetadataexchange" />
</ Service >
</ Services >
<! -- Metadata Exchange behavior Configuration -->
< Behaviors >
< Servicebehaviors >
< Behavior Name = "Testbehavior" >
<! -- Metadata Exchange Based on HTTP-GET -->
< Servicemetadata Httpgetenabled = "True" />
<! -- Displays detailed exception information -->
< Servicedebug Includeexceptiondetailinfaults = "True" />
</ Behavior >
</ Servicebehaviors >
</ Behaviors >
<! -- Custom binding -->
< Bindings >
< Basichttpbinding >
< Binding Name = "Basichttpbinding_itest" Messageencoding = "Text" Textencoding = "UTF-8" Transfermode = "Buffered" Usedefawebwebproxy = "True" >
< Readerquotas Maxdepth = "32" Maxstringcontentlength = "8192" Maxarraylength = "16384" Maxbytesperread = "4096" Maxnametablecharcount = "16384" />
< Security Mode = "NONE" >
< Transport Clientcredentialtype = "NONE" Proxycredentialtype = "NONE" Realm = "" />
< Message Clientcredentialtype = "Username" Algorithmsuite = "Default" />
</ Security >
</ Binding >
</ Basichttpbinding >
</ Bindings >
</ System. servicemodel >