Detailed description of the WCF configuration file (1)

Source: Internet
Author: User
<? XML version = "1.0" encoding = "UTF-8" ?>
< Configuration >
<! -- <System. servicemodel> section -->
< System. servicemodel >
<! -- The services element contains the Configuration Requirements of all services resident in the application. -->
< Services >
<! -- Configuration of each Service
Attribute description:
Name-specify the service configuration for which the service is targeted. It is a fully qualified name for a service that implements certain contract.
(Namespace. type name), after servicehost loads a service, it will go to <services> in the configuration file to find whether
Configuration of <service> matching the name attribute and service
Behaviorconfiguration-specifies the name of <behavior> under <servicebehaviors>, which is specific to <behavior>
This service has some behaviors, such as whether the service allows identity simulation. -->
< Service Name = "Namespace. type name" Behaviorconfiguration = "Behavior name" >
<! -- Each service can have multiple endpoints. The <endpoint> element below configures each endpoint separately.
Attribute description:
Address-specify the external URI of this endpoint. This URI can be an absolute address or relative to baseaddress.
Relative address. If this attribute is blank, the endpoint address is baseaddress.
Binding-specify the binding used by this endpoint. This banding can be one of the nine binding predefined by the system,
For example, it is basichttpbinding or custom mbmbinding. Binding determines the communication type,
Security, how to code, whether it is based on session, whether it is based on transactions, etc.
Contract-specify the fully qualified name (namespace. type name) of the contract corresponding to this endpoint. This contract should be
The service implementation specified by the name of the Service Element
Bindingconfiguration-specify the configuration name of a binding, which matches the name of the <bindings> similar to <binding> below
Name-endpoint name, an optional attribute. Each contract can have multiple endpoints, but each contract corresponds
Multiple endpoint names must be unique -->
< Endpoint Address = "Uri" Binding = "Basichttpbinding" Contract = "Contract full qualified name" Bindingconfiguration = "Binding name" Name = "" >
<! -- User-defined XML Element Set, which is generally used as the header content of soap -->
< Headers >
<! -- Any XML content -->
</ Headers >
< Identity >
<! -- All elements under <identity> are optional. -->
< Userprincipalname > </ Userprincipalname >
< Serviceprincipalname > </ Serviceprincipalname >
< DNS > </ DNS >
< RSA > </ RSA >
< Certificate Encodedvalue = "" > </ Certificate >
<! -- all attributes are optional.
attribute description:
storename-certificate storage area, which may be set: addressbook, authroot, certificateauthority
disallowed, my, root, trustedpeople, trustedpublisher
storelocation-certificate storage location, which may be: currentuser, localmachine -->
< Certificatereference Storename = "" Storelocation = "" >
</ Certificatereference >
</ Identity >
</ Endpoint >
< Host >
< Baseaddresses >
<! -- The baseaddress of each transmission protocol can be defined here for the relative location defined by the same transmission protocol endpoint
An address is a complete address, but each transmission protocol can only define one baseaddress. The HTTP baseaddress is both a service
URL for publishing metadata externally -->
< Add Baseaddress = "Http: // address"   />
</ Baseaddresses >
< Timeouts > </ Timeouts >
</ Host >
</ Service >
</ Services >

< Bindings >
<! -- Specify one or more pre-defined bindings, such as <basichttpbinding>. You can also specify custom mbmbinding,
Create one or more configurations under a specified binding to be used by the endpoint. -->
< Basichttpbinding >
<! -- There may be multiple configurations under a type of binding. The name attribute of the binding element identifies a binding. -->
< Binding Name = "Binding name" >
</ Binding >
</ Basichttpbinding >
</ Bindings >
<! -- Define service and endpiont Behavior -->
< Behaviors >
<! -- Define Service Behavior -->
< Servicebehaviors >
<! -- Behavior elements provided or customized by one or more systems
Attribute description:
Name-a unique behavior identifier. The behaviorconfiguration attribute of the <service> element points to this name -->
< Behavior Name = "" >
<! -- Service metadata publishing and related information
Attribute description:
The value of the httpgetenabled-bool type indicates whether to allow the http get method to obtain the WSDL metadata of sevice.
Httpgeturl-If httpgetenabled is true, this attribute indicates the URL used to publish the Service's WSDL,
If this attribute is not set, add? WSDL -->
< Servicemetadata Httpgetenabled = "True" Httpgeturl = "Http: // URI: Port/address"   />
</ Behavior >
</ Servicebehaviors >
<! -- Define the behavior of endpiont -->
< Endpointbehaviors >
</ Endpointbehaviors >
</ Behaviors >
<! -- Configuration of the endpoint used by the client to connect to the server -->
< Client >
<! -- Set each client endpoint
Attribute description:
Address-address corresponding to the endpoint on the server
Binding-specify the binding used by this endpoint. This banding can be one of the nine binding predefined by the system,
For example, basichttpbinding.
Contract-specify the fully qualified name of the Contract corresponding to this endpoint (namespace. type name)
Name-endpoint configuration name. The endpointconfigurationname In the constructor of the client proxy class corresponds to this name.
Bindingconfiguration-specifies the specific settings of the client binding, pointing to the name of the same type of binding in the <bindings> element -->
< Endpoint Address = "Uri"
Binding = "Basichttpbinding" Bindingconfiguration = "Binding name"
Contract = "Contract full qualified name" Name = "Endpoint configuration name"   />
</ Client >
</ System. servicemodel >
</ Configuration >

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.