locked
UsernameOverTransport security binding causes Channel Closed Event to be fired server side instead of client side RRS feed

  • Question

  •  Hi,

    I recently started using UsernameOverTransport security within our app to secure our Polling Duplex web service. My tests have shown that adding the security causes the ICommunicationObject.Closed event to fire server side instead of client side. This does not work for us, is there anyway to get the closed event to fire client side? Here are the binding configurations that will cause this.

     This binding causes the event to be fired client side (no security binding element):

                  PollingDuplexBindingElement pdbe = new PollingDuplexBindingElement()
    {
    ServerPollTimeout = TimeSpan.FromSeconds(20),
    InactivityTimeout = TimeSpan.FromMinutes(20),
    MaxPendingMessagesPerSession = int.MaxValue,
    MaxPendingSessions = int.MaxValue
    };

    CustomBinding binding = new CustomBinding(
    pdbe,
    new BinaryMessageEncodingBindingElement(),
    new HttpsTransportBindingElement {AuthenticationScheme = AuthenticationSchemes.Anonymous}
    );

      This binding causes the closed event to be fired server side:

      
    PollingDuplexBindingElement pdbe = new PollingDuplexBindingElement()
    {
    ServerPollTimeout = TimeSpan.FromSeconds(20),
    InactivityTimeout = TimeSpan.FromMinutes(20),
    MaxPendingMessagesPerSession = int.MaxValue,
    MaxPendingSessions = int.MaxValue
    };

    var sbe = SecurityBindingElement.CreateUserNameOverTransportBindingElement();
    sbe.IncludeTimestamp = false;

    CustomBinding binding = new CustomBinding(
    sbe,
    pdbe,
    new BinaryMessageEncodingBindingElement(),
    new HttpsTransportBindingElement {AuthenticationScheme = AuthenticationSchemes.Anonymous}
    );

      I'm very interested to know the cause of this!

    Thanks,

     Adam

    Sunday, December 6, 2009 10:49 PM