Create XML representation of WCF binding instance
问题 I'm trying to write code to convert a WCF wsHttpBinding to customBinding, using the method described on WSHttpBinding.CreateBindingElements Method . Binding wsHttpBinding = ... BindingElementCollection beCollection = originalBinding.CreateBindingElements(); foreach (var element in beCollection) { customBinding.Elements.Add(element); } Once I have generated the custom binding, I want to generate an XML representation for that new custom binding. (The same XML representation that's found in an