共用方式為


<customBinding>

Provides full control over the messaging stack for the user.

<system.serviceModel>

  <bindings>

    <customBinding>

                                    
                                    <customBinding>
                                
                                    
                                        <binding name="string"
                                
                                    
                                            closeTimeout="TimeSpan"
                                
                                    
                                            openTimeout="TimeSpan" 
                                
                                    
                                            receiveTimeout="TimeSpan"
                                
                                    
                                            sendTimeout="TimeSpan"
                                
                                    
                                           <compositeDuplex clientBaseAddress="Uri"/>
                                
                                    
                                           <reliableSession acknowledgementInterval="TimeSpan"
                                
                                    
                                               advancedFlowControl="Boolean" 
                                
                                    
                                               bufferedMessagesQuota="Integer"
                                
                                    
                                               inactivityTimeout="TimeSpan"
                                
                                    
                                               maxPendingChannels="Integer"
                                
                                    
                                               maxRetryCount="Integer" 
                                
                                    
                                               ordered="Boolean" />
                                
                                    
                                           <pnrpPeerResolver />
                                
                                    
                                           <windowsStreamSecurity protectionLevel="None/Sign/EncryptAndSign"/>
                                
                                    
                                           <sslStreamSecurity requireClientCertificate="Boolean" />
                                
                                    
                                               
                                    
                                           <transactionFlow transactionProtocol="OleTransactions/WSAtomicTransactionOctober2004"/>
                                
                                    
                                           <security defaultAlgorithmSuite="Aes128/Aes192/Aes256/Rsa15Aes128/Rsa15Aes256"
                                
                                    
                                               authenticationMode="UserNameForAnonymous"
                                
                                    
                                               contextMode="Cookie" 
                                
                                    
                                               defaultProtectionLevel="Sign"
                                
                                    
                                               enableKeyDerivation="false"
                                
                                    
                                               keyEntropyMode="ClientEntropy" 
                                
                                    
                                             messageProtectionOrder="SignBeforeEncryptAndEncryptSignature" 
                                
                                    
                                               securityVersion="WSSecurityXXX2005">
                                
                                    
                                               <localClientSettings cacheCookies="false"
                                
                                    
                                                   detectReplays="false"
                                
                                    
                                                   maxCookieCachingTime="00:07:24" />
                                
                                    
                                               <localServiceSettings replayCacheSize="9"
                                
                                    
                                                   maxClockSkew="00:00:03" 
                                
                                    
                                                   replayWindow="00:07:22.2190000" />
                                
                                    
                                           </security>
                                
                                    
                                           <binaryMessageEncoding maxReadPoolSize="Integer"
                                
                                    
                                               maxWritePoolSize="Integer"
                                
                                    
                                               maxSessionSize="Integer" />
                                
                                    
                                           <httpsTransport manualAddressing="Boolean"
                                
                                    
                                               maxMessageSize="Integer"
                                
                                    
                                               authenticationScheme="Negotiate" 
                                
                                    
                                               bypassProxyOnLocal="Boolean"
                                
                                    
                                               hostNameComparisonMode="Exact" 
                                
                                    
                                               mapAddressingHeadersToHttpHeaders="Boolean" 
                                
                                    
                                               proxyaddress="Uri"
                                
                                    
                                               realm="String" 
                                
                                    
                                               requireClientCertificate="Boolean" />
                                
                                    
                                           <peerTransport manualAddressing="false"
                                
                                    
                                              maxMessageSize="20002"
                                
                                    
                                              listenIPAddress="202.10.1.9" 
                                
                                    
                                              messageAuthentication="false"
                                
                                    
                                              peerNodeAuthenticationMode="None"
                                
                                    
                                              port="1000" />
                                
                                    
                                        
                                    
                                    
                                
                                    
                                    <security defaultAlgorithmSuite="Aes128"
                                
                                    
                                       authenticationMode="UserNameForAnonymous"
                                
                                    
                                       bootstrapBindingConfiguration="String"
                                
                                    
                                       bootstrapBindingSectionName="String"
                                
                                    
                                       defaultProtectionLevel="None/Sign/EncryptAndSign"
                                
                                    
                                           
                                    
                                       requireDerivedKeys="Boolean"
                                
                                    
                                       securityHeaderLayout="Strict/Lax/LaxTimestampFirst/LaxTimestampLast"
                                
                                    
                                       includeTimestamp="Boolean"
                                
                                    
                                       keyEntropyMode="ClientEntropy/ServerEntropy/CombinedEntropy" 
                                
                                    
                                       messageProtectionOrder="SignBeforeEncrypt/SignBeforeEncryptAndEncryptSignature/EncryptBeforeSign" 
                                
                                    
                                       protectTokens="Boolean"
                                
                                    
                                       requireSecurityContextCancellation="Boolean"
                                
                                    
                                       securityVersion=" WSSecurityJan2004/WSSecurityXXX2005"
                                
                                    
                                       requireSignatureConfirmation="Boolean" >
                                
                                    
                                       <localClientSettings cacheCookies="Boolean"
                                
                                    
                                          detectReplays="Boolean"
                                
                                    
                                          replayCacheSize="Integer"
                                
                                    
                                          maxClockSkew="TimeSpan"
                                
                                    
                                          maxCookieCachingTime="TimeSpan"
                                
                                    
                                          replayWindow="TimeSpan"
                                
                                    
                                          sessionKeyRenewalInterval="TimeSpan"
                                
                                    
                                          sessionKeyRolloverInterval="TimeSpan"
                                
                                    
                                          reconnectOnTransportFailure="Boolean"
                                
                                    
                                          timestampValidityDuration="TimeSpan"
                                
                                    
                                          cookieRenewalThresholdPercentage="Integer" />
                                
                                    
                                       <localServiceSettings detectReplays="Boolean"
                                
                                    
                                          issuedCookieLifeTime="TimeSpan"
                                
                                    
                                          maxStatefulNegotiations="Integer"
                                
                                    
                                              
                                    
                                          replayCacheSize="Integer"
                                
                                    
                                          maxClockSkew="TimeSpan" 
                                
                                    
                                          negotiationTimeout="TimeSpan"
                                
                                    
                                          replayWindow="TimeSpan"
                                
                                    
                                          inactivityTimeout="TimeSpan"
                                
                                    
                                          sessionKeyRenewalInterval="TimeSpan"
                                
                                    
                                          sessionKeyRolloverInterval="TimeSpan"
                                
                                    
                                          reconnectOnTransportFailure="Boolean"
                                
                                    
                                          maxConcurrentSessions="Integer"
                                
                                    
                                          timestampValidityDuration="TimeSpan" />
                                
                                    
                                       <federationParameters trustVersion="WSTrustApr2004/WSTrustFeb2005" />
                                
                                    
                                    <security defaultAlgorithmSuite="Aes128"
                                
                                    
                                       authenticationMode="UserNameForAnonymous"
                                
                                    
                                       bootstrapBindingConfiguration="String"
                                
                                    
                                       bootstrapBindingSectionName="String"
                                
                                    
                                       defaultProtectionLevel="None/Sign/EncryptAndSign"
                                
                                    
                                           
                                    
                                       requireDerivedKeys="Boolean"
                                
                                    
                                       securityHeaderLayout="Strict/Lax/LaxTimestampFirst/LaxTimestampLast"
                                
                                    
                                       includeTimestamp="Boolean"
                                
                                    
                                       keyEntropyMode="ClientEntropy/ServerEntropy/CombinedEntropy" 
                                
                                    
                                       messageProtectionOrder="SignBeforeEncrypt/SignBeforeEncryptAndEncryptSignature/EncryptBeforeSign" 
                                
                                    
                                       protectTokens="Boolean"
                                
                                    
                                       requireSecurityContextCancellation="Boolean"
                                
                                    
                                       securityVersion=" WSSecurityJan2004/WSSecurityXXX2005"
                                
                                    
                                       requireSignatureConfirmation="Boolean" >
                                
                                    
                                       <localClientSettings cacheCookies="Boolean"
                                
                                    
                                          detectReplays="Boolean"
                                
                                    
                                          replayCacheSize="Integer"
                                
                                    
                                          maxClockSkew="TimeSpan"
                                
                                    
                                          maxCookieCachingTime="TimeSpan"
                                
                                    
                                          replayWindow="TimeSpan"
                                
                                    
                                          sessionKeyRenewalInterval="TimeSpan"
                                
                                    
                                          sessionKeyRolloverInterval="TimeSpan"
                                
                                    
                                          reconnectOnTransportFailure="Boolean"
                                
                                    
                                          timestampValidityDuration="TimeSpan"
                                
                                    
                                          cookieRenewalThresholdPercentage="Integer" />
                                
                                    
                                       <localServiceSettings detectReplays="Boolean"
                                
                                    
                                          issuedCookieLifeTime="TimeSpan"
                                
                                    
                                          maxStatefulNegotiations="Integer"
                                
                                    
                                              
                                    
                                          replayCacheSize="Integer"
                                
                                    
                                          maxClockSkew="TimeSpan" 
                                
                                    
                                          negotiationTimeout="TimeSpan"
                                
                                    
                                          replayWindow="TimeSpan"
                                
                                    
                                          inactivityTimeout="TimeSpan"
                                
                                    
                                          sessionKeyRenewalInterval="TimeSpan"
                                
                                    
                                          sessionKeyRolloverInterval="TimeSpan"
                                
                                    
                                          reconnectOnTransportFailure="Boolean"
                                
                                    
                                          maxConcurrentSessions="Integer"
                                
                                    
                                          timestampValidityDuration="TimeSpan" />
                                
                                    
                                       <federationParameters trustVersion="WSTrustApr2004/WSTrustFeb2005" />
                                
                                    
                                       <GenericIssuedTokenParameters> 
                                
                                    
                                          <LocalIssuerIssuedTokenParameters keyType=" SymmeticKey/PublicKey"
                                
                                    
                                            keySize="Integer"
                                
                                    
                                            tokenType="String" />
                                
                                    
                                         <IssuedTokenParametersEndpointAddress address="URI"
                                
                                    
                                            bindingConfiguration="String"
                                
                                    
                                            bindingSectionName="String" />
                                
                                    
                                         <IssuedTokenClient localIssuerChannelBehaviors="String"
                                
                                    
                                            cacheIssuedTokens="Boolean"
                                
                                    
                                            maxIssuedTokenCachingTime="TimeSpan"
                                
                                    
                                            keyEntropyMode="ClientEntropy/ServerEntropy/CombinedEntropy" />
                                
                                    
                                         <IssuedTokenClientBehavior issuerAddress="String"
                                
                                    
                                            behaviorConfiguration="String" />
                                
                                    
                                         <IssuedTokenClientBehavior address="URI"
                                
                                    
                                            bindingConfiguration="String"
                                
                                    
                                            bindingSectionName="String" />
                                
                                    
                                       </GenericIssuedTokenParameters> 
                                
                                    
                                    </security>
                                
                                    
                                    </binding>
                                
                                    
                                    </customBinding>
                                

Attributes and Elements

The following sections describe attributes, child elements, and parent elements

Attributes

Attribute Description

closeTimeout

A TimeSpan value that specifies the interval of time provided for a close operation to complete. This value should be greater than or equal to Zero. The default is 00:01:00.

name

A string that contains the configuration name of the binding. This value is a user-defined string that acts as the identification string for the custom binding.

openTimeout

A TimeSpan value that specifies the interval of time provided for an open operation to complete. This value should be greater than or equal to Zero. The default is 00:01:00.

receiveTimeout

A TimeSpan value that specifies the interval of time provided for a receive operation to complete. This value should be greater than or equal to Zero. The default is 00:01:00.

sendTimeout

A TimeSpan value that specifies the interval of time provided for a send operation to complete. This value should be greater than or equal to Zero. The default is 00:01:00.

Child Elements

Element Description

<compositeDuplex>

Specifies two-way messaging to the custom binding. It is used with transports that do not allow duplex communications natively, for example, HTTP. TCP, by contrast, allows duplex communications natively, and does not require the use of this binding element for the service to send messages back to a client.

The client must expose an address for the service to make contact and establish a connection. This client address is provided by the ClientBaseAddress attribute.

This element is of type CompositeDuplexElement.

<pnrpPeerResolver>

Specifies a Peer Name Resolution Protocol (PNRP) peer name resolver. This element is of type PnrpPeerResolverElement.

<reliableSession>

Specifies the setting for WS-Reliable Messaging. When this element is added to a custom binding, the resulting channel can support exactly-once delivery assurances. This element is of type ReliableSessionElement.

<security> of <customBinding>

Specifies the options for security of the custom binding. This element is of type SecurityElement.

<sslStreamSecurity>

Specifies the security settings for a SSL stream binding. This element is of type SslStreamSecurityElement.

<transactionFlow>

Specifies that the binding supports transaction flow, and the protocol to be used by the transactionProtocol attribute. This element is of type TransactionFlowElement.

<windowsStreamSecurity>

Specifies the options for streaming security of the custom binding. This element is of type WindowsStreamSecurityElement.

Parent Elements

Element Description

bindings

Contains all bindings for Windows Communication Foundation applications.

Remarks

Custom bindings provide full control over the WCF messaging stack. Special tailored bindings can be created my adding the configuration elements for specific entities. For example, the user can combine the httpsTransport section, reliableSession section and the security section to create a reliable and secure https based binding.

An individual binding defines the message stack by specifying the configuration elements for the stack elements in the order they appear on the stack. Each element defines and configures the one element of the stack. There must be one and only one transport element in each custom binding. Without this element, the messaging stack is incomplete.

The order in which elements appear in the stack matters, because it is the order in which operations are applied to the message. The recommended order of stack elements is the following:

  1. Transactions (optional)

  2. Reliable Messaging (optional)

  3. Security (optional)

  4. Transport

  5. Encoder (optional)

See Also

Concepts

<binding>

Other Resources

Windows Communication Foundation Bindings

Footer image

Send comments about this topic to Microsoft.
© Microsoft Corporation. All rights reserved.