Export (0) Print
Expand All

PollingDuplexHttpBinding Class

Silverlight

Represents a binding that a Silverlight 5 client can use to configure endpoints that can communicate with Windows Communication Foundation (WCF) services that are similarly configured for duplex communication with a polling client.

System.Object
  System.ServiceModel.Channels.Binding
    System.ServiceModel.PollingDuplexHttpBinding

Namespace:  System.ServiceModel
Assembly:  System.ServiceModel.PollingDuplex (in System.ServiceModel.PollingDuplex.dll)

public class PollingDuplexHttpBinding : Binding

The PollingDuplexHttpBinding type exposes the following members.

  NameDescription
Public methodPollingDuplexHttpBinding()Initializes a new instance of the PollingDuplexHttpBinding class.
Public methodPollingDuplexHttpBinding(PollingDuplexHttpSecurityMode)Initializes a new instance of the PollingDuplexHttpBinding class with a specified type of security used by the binding.
Public methodPollingDuplexHttpBinding(PollingDuplexMode)Initializes a new instance of the PollingDuplexHttpBinding class with a specified mode of behavior on the server in response to client polling.
Public methodPollingDuplexHttpBinding(PollingDuplexHttpSecurityMode, PollingDuplexMode)Initializes a new instance of the PollingDuplexHttpBinding class with a specified type of security and a specified mode of behavior on the server in the way it responses to client polling.
Top

  NameDescription
Public propertyCloseTimeoutGets or sets the interval of time provided for a connection to close before the transport raises an exception. (Inherited from Binding.)
Public propertyDuplexModeGets or sets a value that specifies how the server behaves in response to client polling when the communication is configured for duplex polling.
Public propertyEnvelopeVersionGets the version of SOAP that is used for messages that are processed by this binding.
Public propertyInactivityTimeoutGets or sets the maximum interval of time that can pass without activity on a channel before the client or server channel enters a faulted state. The default value is 10 minutes.
Public propertyMaxBufferSizeGets or sets the maximum size for a buffer that receives messages from the channel.
Public propertyMaxReceivedMessageSizeGets or sets the maximum size for a message that can be received on a channel configured with this binding.
Public propertyMessageVersionGets the message version used by clients and services configured with the binding. (Inherited from Binding.)
Public propertyNameGets or sets the name of the binding. (Inherited from Binding.)
Public propertyNamespaceGets or sets the XML namespace of the binding. (Inherited from Binding.)
Public propertyOpenTimeoutGets or sets the interval of time provided for a connection to open before the transport raises an exception. (Inherited from Binding.)
Public propertyReceiveTimeoutGets or sets the interval of time that a connection can remain inactive, during which no application messages are received, before it is dropped. (Inherited from Binding.)
Public propertySchemeGets the URI transport scheme for the channels and listeners that are configured with this binding. (Overrides Binding.Scheme.)
Public propertySecurityGets the type of security used with this binding.
Public propertySendTimeoutGets or sets the interval of time provided for a write operation to complete before the transport raises an exception. (Inherited from Binding.)
Public propertyTextEncodingGets or sets the character encoding that is used for the message text.
Public propertyUseTextEncodingGets or sets a value that indicates whether text or binary encoding is used for the message.
Top

  NameDescription
Public methodBuildChannelFactory<TChannel>(BindingParameterCollection)Builds the channel factory stack on the client that creates a specified type of channel and that satisfies the features specified by a collection of binding parameters. (Inherited from Binding.)
Public methodBuildChannelFactory<TChannel>(Object[])Builds the channel factory stack on the client that creates a specified type of channel and that satisfies the features specified by an object array. (Inherited from Binding.)
Public methodCanBuildChannelFactory<TChannel>(BindingParameterCollection)Returns a value that indicates whether the current binding can build a channel factory stack on the client that satisfies the collection of binding parameters specified. (Inherited from Binding.)
Public methodCanBuildChannelFactory<TChannel>(Object[])Returns a value that indicates whether the current binding can build a channel factory stack on the client that satisfies the requirements specified by an object array. (Inherited from Binding.)
Public methodCreateBindingElementsReturns an ordered collection of binding elements contained in the current binding. (Overrides Binding.CreateBindingElements().)
Public methodEquals(Object)Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection. (Inherited from Object.)
Public methodGetHashCodeServes as a hash function for a particular type. (Inherited from Object.)
Public methodGetProperty<T>Returns a typed object requested, if present, from the appropriate layer in the binding stack. (Inherited from Binding.)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)
Top

Security is turned off by default, but can be added by setting the PollingDuplexHttpSecurityMode to a value other than None in the PollingDuplexHttpBinding(PollingDuplexHttpSecurityMode) constructor.

The binding is configured to use a binary message encoding and UTF-8 character encoding by default.

There are two time-outs on the PollingDuplexBindingElement used by this binding that are set to default values. ClientPollTimeout specifies the interval of time that a polling request has to complete before timing out; the default value is 5 minutes. The InactivityTimeout specifies the maximum interval of time that can pass without activity on a channel before it enters a faulted state; the default value is 10 minutes. The InactivityTimeout() property can be used to change the default value directly on the binding. But value of thePollTimeout() can be changed on the PollingDuplexBindingElement only when constructing a stack of binding elements for a CustomBinding.



            //Constructors set with different security modes
            PollingDuplexHttpBinding defaultNoSecurityPDBinding = new PollingDuplexHttpBinding();
            PollingDuplexHttpBinding transportSecurityPDBinding = new PollingDuplexHttpBinding(BasicHttpSecurityMode.Transport);
            PollingDuplexHttpBinding transportOnlySecurityPDBinding = new PollingDuplexHttpBinding(BasicHttpSecurityMode.TransportCredentialOnly);

            //Output txtSecurityMode for binding with transport security: Transport
            string txtSecurityMode = transportSecurityPDBinding.Security.Mode.ToString();


            //Inactivity timeout
            PollingDuplexHttpBinding binding = new PollingDuplexHttpBinding();

            //Get default inactivity timeout
            TimeSpan defaultInactivityTimeOut = binding.InactivityTimeout;
            //Returns default timeout in minutes: 10
            string txtDefaultInactivityTimeOut = defaultInactivityTimeOut.Minutes.ToString();

            //Set new inactivity timeout
            TimeSpan newInactivityTimeOut = new TimeSpan(0, 5, 0);
            binding.InactivityTimeout = newInactivityTimeOut;
            //Returns new timeout in minutes: 5
            string txtNewInactivityTimeOut = binding.InactivityTimeout.Minutes.ToString();

            PollingDuplexHttpBinding pollingDuplexBinding = new PollingDuplexHttpBinding();
            BindingElementCollection bindingEC = pollingDuplexBinding.CreateBindingElements();
            //Check on binding elements contained in the collection
            bool boolHTBE = bindingEC.Contains(typeof(HttpTransportBindingElement));
            //Returns true
            string txtboolHTBE = boolHTBE.ToString();
            bool boolHSTBE = bindingEC.Contains(typeof(HttpsTransportBindingElement));
            //Returns false
            string txtboolHSTBE = boolHSTBE.ToString();



Silverlight

Supported in: 5, 4, 3

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Community Additions

ADD
Show:
© 2014 Microsoft