<customBinding>
Zapewnia pełną kontrolę nad stosem obsługi komunikatów dla użytkownika.Provides full control over the messaging stack for the user.
<configuration>
<system.serviceModel>
<bindings>
<customBinding>
SkładniaSyntax
<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="Basic128/Basic192/Basic256/Basic128Rsa15/Basic256Rsa15/TripleDes/TripleDesRsa15/Basic128Sha256/Basic192Sha256/TripleDesSha256/Basic128Sha256Rsa15/Basic192Sha256Rsa15/Basic256Sha256Rsa15/TripleDesSha256Rsa15"
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="Basic128/Basic192/Basic256/Basic128Rsa15/Basic256Rsa15/TripleDes/TripleDesRsa15/Basic128Sha256/Basic192Sha256/TripleDesSha256/Basic128Sha256Rsa15/Basic192Sha256Rsa15/Basic256Sha256Rsa15/TripleDesSha256Rsa15"
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>
<security defaultAlgorithmSuite="Basic128/Basic192/Basic256/Basic128Rsa15/Basic256Rsa15/TripleDes/TripleDesRsa15/Basic128Sha256/Basic192Sha256/TripleDesSha256/Basic128Sha256Rsa15/Basic192Sha256Rsa15/Basic256Sha256Rsa15/TripleDesSha256Rsa15"
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="SymmetricKey/PublicKey"
keySize="Integer"
tokenType="String" />
<issuedTokenParametersEndpointAddress address="URI"
bindingConfiguration="String"
binding="String" />
<issuedTokenClient localIssuerChannelBehaviors="String"
cacheIssuedTokens="Boolean"
maxIssuedTokenCachingTime="TimeSpan"
keyEntropyMode="ClientEntropy/ServerEntropy/CombinedEntropy" />
<issuedTokenClientBehavior issuerAddress="String"
behaviorConfiguration="String" />
<issuedTokenClientBehavior address="URI"
bindingConfiguration="String"
binding="String" />
</genericIssuedTokenParameters>
</security>
</binding>
</customBinding>
Atrybuty i elementyAttributes and Elements
W poniższych sekcjach opisano atrybuty, elementy podrzędne i elementy nadrzędne.The following sections describe attributes, child elements, and parent elements
AtrybutyAttributes
AtrybutAttribute | OpisDescription |
---|---|
closeTimeoutcloseTimeout | TimeSpanWartość określająca interwał czasu podanego do ukończenia operacji zamknięcia.A TimeSpan value that specifies the interval of time provided for a close operation to complete. Ta wartość powinna być większa lub równa Zero .This value should be greater than or equal to Zero. Wartość domyślna to 00:01:00.The default is 00:01:00. |
namename | Ciąg zawierający nazwę konfiguracji powiązania.A string that contains the configuration name of the binding. Ta wartość jest ciągiem zdefiniowanym przez użytkownika, który działa jako ciąg identyfikacyjny dla niestandardowego powiązania.This value is a user-defined string that acts as the identification string for the custom binding. Począwszy od .NET Framework 4, powiązania i zachowania nie muszą mieć nazwy.Starting with .NET Framework 4, bindings and behaviors are not required to have a name. Aby uzyskać więcej informacji na temat konfiguracji domyślnej i powiązań pustego i zachowań, zobacz Uproszczona konfiguracja i Uproszczona konfiguracja dla usług WCF.For more information about default configuration and nameless bindings and behaviors, see Simplified Configuration and Simplified Configuration for WCF Services. |
openTimeoutopenTimeout | TimeSpanWartość, która określa przedział czasu podanego na zakończenie operacji otwarcia.A TimeSpan value that specifies the interval of time provided for an open operation to complete. Ta wartość powinna być większa lub równa Zero .This value should be greater than or equal to Zero. Wartość domyślna to 00:01:00.The default is 00:01:00. |
receiveTimeoutreceiveTimeout | Wartość określająca TimeSpan interwał czasu podanego do ukończenia operacji odbioru.A TimeSpan value that specifies the interval of time provided for a receive operation to complete. Ta wartość powinna być większa lub równa Zero .This value should be greater than or equal to Zero. Wartość domyślna to 00:01:00.The default is 00:01:00. |
Właściwości SendTimeoutsendTimeout | TimeSpanWartość określająca interwał czasu podanego do ukończenia operacji wysyłania.A TimeSpan value that specifies the interval of time provided for a send operation to complete. Ta wartość powinna być większa lub równa Zero .This value should be greater than or equal to Zero. Wartość domyślna to 00:01:00.The default is 00:01:00. |
Elementy podrzędneChild Elements
ElementElement | OpisDescription |
---|---|
<compositeDuplex> | Określa komunikat dwukierunkowy dla niestandardowego powiązania.Specifies two-way messaging to the custom binding. Jest on używany z transportami, które nie zezwalają na natywną komunikację bezstronną, na przykład HTTP.It is used with transports that do not allow duplex communications natively, for example, HTTP. Protokół TCP, w przeciwieństwie, umożliwia natywną komunikację bezstronną i nie wymaga użycia tego elementu powiązania dla usługi do wysyłania komunikatów z powrotem do klienta.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. Klient musi uwidocznić adres usługi, aby nawiązać kontakt i nawiązać połączenie.The client must expose an address for the service to make contact and establish a connection. Ten adres klienta jest dostarczany przez ClientBaseAddress atrybut.This client address is provided by the ClientBaseAddress attribute.Ten element jest typu CompositeDuplexElement .This element is of type CompositeDuplexElement. |
<pnrpPeerResolver> | Określa program rozpoznawania nazw elementów równorzędnych protokołu PNRP (Peer Name Resolution Protocol).Specifies a Peer Name Resolution Protocol (PNRP) peer name resolver. Ten element jest typu PnrpPeerResolverElement .This element is of type PnrpPeerResolverElement. |
<reliableSession> | Określa ustawienie dla obsługi komunikatów w usłudze WS-niezawodny.Specifies the setting for WS-Reliable Messaging. Gdy ten element zostanie dodany do niestandardowego powiązania, otrzymany kanał może obsługiwać tylko jednokrotne gwarancje dostarczania.When this element is added to a custom binding, the resulting channel can support exactly-once delivery assurances. Ten element jest typu ReliableSessionElement .This element is of type ReliableSessionElement. |
<security> | Określa opcje zabezpieczeń niestandardowego powiązania.Specifies the options for security of the custom binding. Ten element jest typu SecurityElement .This element is of type SecurityElement. |
<sslStreamSecurity> | Określa ustawienia zabezpieczeń dla powiązania strumienia SSL.Specifies the security settings for a SSL stream binding. Ten element jest typu SslStreamSecurityElement .This element is of type SslStreamSecurityElement. |
<transactionFlow> | Określa, że powiązanie obsługuje przepływ transakcji, oraz protokołu, który ma być używany przez transactionProtocol atrybut.Specifies that the binding supports transaction flow, and the protocol to be used by the transactionProtocol attribute. Ten element jest typu TransactionFlowElement .This element is of type TransactionFlowElement. |
<windowsStreamSecurity> | Określa opcje zabezpieczeń przesyłania strumieniowego dla niestandardowego powiązania.Specifies the options for streaming security of the custom binding. Ten element jest typu WindowsStreamSecurityElement .This element is of type WindowsStreamSecurityElement. |
Elementy nadrzędneParent Elements
ElementElement | OpisDescription |
---|---|
powiązaniabindings | Zawiera wszystkie powiązania dla Windows Communication Foundation aplikacji.Contains all bindings for Windows Communication Foundation applications. |
UwagiRemarks
Niestandardowe powiązania zapewniają pełną kontrolę nad stosem obsługi komunikatów WCF.Custom bindings provide full control over the WCF messaging stack. Można utworzyć specjalne powiązania dostosowane, dodając elementy konfiguracji dla określonych jednostek.Special tailored bindings can be created my adding the configuration elements for specific entities. Na przykład użytkownik może połączyć httpsTransport
sekcję, reliableSession
sekcję i security
sekcję, aby utworzyć niezawodne i bezpieczne powiązanie https.For example, the user can combine the httpsTransport
section, reliableSession
section and the security
section to create a reliable and secure https based binding.
Pojedyncze powiązanie definiuje stos komunikatów przez określenie elementów konfiguracji dla elementów stosu w kolejności, w jakiej występują na stosie.An individual binding defines the message stack by specifying the configuration elements for the stack elements in the order they appear on the stack. Każdy element definiuje i konfiguruje jeden element stosu.Each element defines and configures the one element of the stack. W każdym powiązaniu niestandardowym musi istnieć jeden i tylko jeden element transportu.There must be one and only one transport element in each custom binding. Bez tego elementu stos komunikatów jest niekompletny.Without this element, the messaging stack is incomplete.
Kolejność, w której elementy pojawiają się w kwestiach stosu, ponieważ jest to kolejność, w której operacje są stosowane do wiadomości.The order in which elements appear in the stack matters, because it is the order in which operations are applied to the message. Zalecana kolejność elementów stosu jest następująca:The recommended order of stack elements is the following:
Transakcje (opcjonalnie)Transactions (optional)
Niezawodna obsługa komunikatów (opcjonalnie)Reliable Messaging (optional)
Zabezpieczenia (opcjonalnie)Security (optional)
TransportTransport
Koder (opcjonalnie)Encoder (optional)
Użyj niestandardowego powiązania, gdy jedno z powiązań dostarczonych przez system nie spełnia wymagań usługi.Use a custom binding when one of the system-provided bindings does not meet the requirements of your service. Można na przykład użyć niestandardowego powiązania, aby umożliwić korzystanie z nowego lub nowego kodera w punkcie końcowym usługi.A custom binding could be used, for example, to enable the use of a new transport or a new encoder at a service endpoint.
Niestandardowe powiązanie jest konstruowane przy użyciu jednej z CustomBinding kolekcji elementów powiązania, które są "ułożone" w określonej kolejności:A custom binding is constructed using one of the CustomBinding from a collection of binding elements that are "stacked" in a specific order:
U góry jest opcjonalne TransactionFlowBindingElement , które umożliwia przepływ transakcji.At the top is an optional TransactionFlowBindingElement that allows flowing transactions.
Następnie jest opcjonalne ReliableSessionBindingElement , które udostępnia mechanizm sesji i kolejności, zgodnie z definicją w specyfikacji WS-ReliableMessaging.Next is an optional ReliableSessionBindingElement that provides a session and ordering mechanism as defined in the WS-ReliableMessaging specification. To pojęcie sesji może przekroczyć pośredniki SOAP i transportu.This notion of a session can cross SOAP and transport intermediaries.
Dalej jest opcjonalny element powiązania zabezpieczeń, który zapewnia funkcje zabezpieczeń, takie jak autoryzacja, uwierzytelnianie, ochrona i poufność.Next is an optional security binding element that provides security features like authorization, authentication, protection, and confidentiality. Następujące elementy powiązań zabezpieczeń są udostępniane przez Windows Communication Foundation (WCF):The following security binding elements are provided by Windows Communication Foundation (WCF):
Następnie są opcjonalne wzorce komunikatów określone przez elementy powiązania:Next are the optional message-patterns specified by binding elements:
Poniżej przedstawiono opcjonalne elementy powiązania uaktualnienia/pomocnika transportu:Next are the optional transport upgrades/helpers binding elements:
Następnie jest wymagany element powiązania kodowania komunikatów.Next is a required message encoding binding element. Możesz użyć własnego transportu lub użyć jednego z następujących powiązań kodowania komunikatów:You can use your own transport or use one of the following message encoding bindings:
U dołu jest wymagany element transportu.At the bottom is a required transport element. Możesz użyć własnego transportu lub użyć jednego z elementów powiązania transportowego dostarczonych przez Windows Communication Foundation (WCF):You can use your own transport or use one of transport binding elements provided by Windows Communication Foundation (WCF):
Poniższa tabela zawiera podsumowanie opcji dla każdej warstwy.The following table summarizes the options for each layer.
WarstwaLayer | OpcjeOptions | WymaganeRequired |
---|---|---|
Przepływ transakcjiTransaction Flow | TransactionFlowBindingElement | NieNo |
NiezawodnośćReliability | ReliableSessionBindingElement | NieNo |
ZabezpieczeniaSecurity | Symetryczne, asymetryczne, na poziomie transportuSymmetric, Asymmetric, Transport-Level | NieNo |
Zmiana kształtuShape Change | CompositeDuplexBindingElement | NieNo |
Uaktualnienia transportuTransport Upgrades | Strumień SSL, strumień systemu Windows, program rozpoznawania elementów równorzędnychSSL stream, Windows stream, Peer Resolver | NieNo |
KodowanieEncoding | Tekst, dane binarne, MTOM, niestandardoweText, Binary, MTOM, Custom | TakYes |
TransportTransport | TCP, nazwane potoki, HTTP, HTTPS, typy usługi MSMQ, niestandardoweTCP, Named Pipes, HTTP, HTTPS, flavors of MSMQ, Custom | TakYes |
Ponadto można definiować własne elementy powiązania i wstawiać je między wszystkimi wcześniej zdefiniowanymi warstwami.In addition, you can define your own binding elements and insert them between any of the preceding defined layers.
Aby uzyskać informacje na temat sposobu użycia niestandardowego powiązania do modyfikacji powiązania dostarczonego przez system, zobacz How to: Dostosowywanie podanego przez system powiązania.For a discussion on how to use a custom binding to modify a system-provided binding, see How to: Customize a System-Provided Binding.
Zobacz takżeSee also
- Binding
- BindingElement
- BindingsSection
- CustomBinding
- <binding>
- PowiązaniaBindings
- Rozszerzanie powiązańExtending Bindings
- Powiązania niestandardoweCustom Bindings
- CustomBinding — elementcustomBinding Element
- PowiązaniaBindings
- Konfigurowanie powiązań dostarczanych przez systemConfiguring System-Provided Bindings
- Konfigurowanie usług i klientów za pomocą powiązańUsing Bindings to Configure Services and Clients