views:

28

answers:

1

I have developed a custom binding which works over http and therefore returns http as it's scheme. My current code to return this scheme is as follow:

My derivation of Binding uses

public override string Scheme {
    get { return this.transportElement.Scheme; }
}

where transportElement is an instance of my custom TransportBindingElement, where the scheme is returned directly by

public override string Scheme {
    get { return "http"; }
}

. Now, I want to add support for https. Depending on the scheme, my channels should open secure connections if requested by the users of my binding.

Is it possible to expose multiple schemes for one binding?

  • If yes, how can I do this (since Scheme returns only a string?)
  • If no, what approach should I take to fulfil my wish?
A: 

The solution seems to be to enable support for a security mode flag, and to change the code to dynamically return a scheme which depends on this flag.

Etan