Detailed description of the WCF configuration file

Source: Internet
Author: User

<? XML version = "1.0" encoding = "UTF-8"?>

<Configuration>

<System. servicemodel>

<! -- The services element contains the Configuration Requirements for 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">

<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 of the service description page for external publishing -->

<Add baseaddress = "http: // address"/>

</Baseaddresses>

<Timeouts> </timeouts>

</Host>

<! -- 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

Behaviorconfiguration-specifies the behavior of this endpoint, pointing to <endpointbehaviors> with the same configuration name under <behaviors>

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" behaviorconfiguration = "string" name = ">

<! -- User-defined XML Element Set, which is generally used as the header content of soap -->

<Headers>

<! -- Any XML content -->

</Headers>

</Endpoint>

</Service>

</Services>

 

<Bindings>

<! -- Specify one or more predefined binding types, 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 <endpoint> behaviorconfiguration attribute under the <service> element points to this name -->

<Behavior name = "this behavior name">

<! -- Specify 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"/>

<! -- Specify the credential used to verify the server -->

<Servicecredentials>

<! -- Specify the server certificate

Attribute description:

Storename-the storage area of the certificate. The possible values are: addressbook, authroot, and certificateauthority.

Disallowed, my, root, trustedpeople, trustedpublisher

Storelocation-certificate storage location, which may be: currentuser, localmachine

X509findtype-Method of searching certificates. Possible values: findbysubjectname, findbythumbprint, findbyissuername ......

Findvalue-the value of the certificate to be searched for in the corresponding query method -->

<Servicecertificate storename = "Storage zone" storelocation = "storage location" x509findtype = "findbysubjectname" findvalue = "server1"/>

</Servicecredentials>

 

</Behavior>

</Servicebehaviors>

<! -- Define the behavior of endpiont -->

<Endpointbehaviors>

<! -- Behavior elements provided or customized by one or more systems

Attribute description:

Name-a unique behavior identifier. The behaviorconfiguration attribute of <endpoint> under the <client> element points to this name -->

<Behavior name = "this behavior name">

<! -- Specify client creden -->

<Clientcredentials>

<! -- Specify the client certificate

Attribute description:

Storename-the storage area of the certificate. The possible values are: addressbook, authroot, and certificateauthority.

Disallowed, my, root, trustedpeople, trustedpublisher

Storelocation-certificate storage location, which may be: currentuser, localmachine

X509findtype-Method of searching certificates. Possible values: findbysubjectname, findbythumbprint, findbyissuername ......

Findvalue-the value of the certificate to be searched for in the corresponding query method -->

<Clientcertificate storename = "Storage zone" storelocation = "storage location" x509findtype = "findbysubjectname" findvalue = "Client1"/>

<Servicecertificate>

<Authentication certificatevalidationmode = "NONE"/>

</Servicecertificate>

</Clientcredentials>

</Behavior>

</Endpointbehaviors>

</Behaviors>

<! -- Contains the 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

Behaviorconfiguration-specify the behavior of this endpoint and point to <endpointbehaviors> -->

<Endpoint address = "Uri" binding = "basichttpbinding" bindingconfiguration = "binding name" behaviorconfiguration = "string" Contract = "contract full qualified name" name = "endpoint configuration name">

<! -- Used to verify the server identity on the client. You can use the following method to verify the server -->

<Identity>

<Userprincipalname> </userprincipalname>

<Serviceprincipalname> </serviceprincipalname>

<! -- If the client authentication is windows, specify the DNS name here; if it is certificate, specify the certificate subject name here -->

<DNS> </DNS>

<RSA> </RSA>

<! -- Specify the public key of the server certificate

Attribute description:

Encodedvalue-base64 encoding of the public key of the server certificate, used to encrypt the user name and password -->

<Certificate encodedvalue = ""> </certificate>

<! -- The server certificate specified by the user in the client certificate Storage Area

Attribute description:

Storename-the storage area of the certificate. The possible values are: addressbook, authroot, and certificateauthority.

Disallowed, my, root, trustedpeople, trustedpublisher

Storelocation-certificate storage location, which may be: currentuser, localmachine

X509findtype-Method of searching certificates. Possible values: findbysubjectname, findbythumbprint, findbyissuername ......

Findvalue-the value of the certificate to be searched for in the corresponding query method -->

<Certificatereference storename = "Storage zone" storelocation = "storage location" x509findtype = "findbysubjectname" findvalue = "Client1"/>

</Identity>

</Endpoint>

</Client>

</System. servicemodel>

</Configuration>

 

This article from the csdn blog, reproduced please indicate the source: http://blog.csdn.net/zhongjiekangping/archive/2009/07/31/4397110.aspx

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.