本文整理汇总了C#中HttpTransportBindingElement.ExportPolicy方法的典型用法代码示例。如果您正苦于以下问题:C# HttpTransportBindingElement.ExportPolicy方法的具体用法?C# HttpTransportBindingElement.ExportPolicy怎么用?C# HttpTransportBindingElement.ExportPolicy使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HttpTransportBindingElement
的用法示例。
在下文中一共展示了HttpTransportBindingElement.ExportPolicy方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ExportPolicyDefault
public void ExportPolicyDefault ()
{
IPolicyExportExtension binding_element = new HttpTransportBindingElement ();
PolicyConversionContext conversion_context = new CustomPolicyConversionContext ();
binding_element.ExportPolicy (new WsdlExporter (), conversion_context);
PolicyAssertionCollection binding_assertions = conversion_context.GetBindingAssertions ();
BindingElementCollection binding_elements = conversion_context.BindingElements;
Assert.AreEqual (1, binding_assertions.Count, "#A0");
Assert.AreEqual (0, binding_elements.Count, "#A1");
// wsaw:UsingAddressing
XmlNode using_addressing_node = FindAssertion (binding_assertions, "wsaw:UsingAddressing");
Assert.AreEqual (true, using_addressing_node != null, "#B0");
Assert.AreEqual ("UsingAddressing", using_addressing_node.LocalName, "#B1");
Assert.AreEqual ("http://www.w3.org/2006/05/addressing/wsdl", using_addressing_node.NamespaceURI, "#B2");
Assert.AreEqual (0, using_addressing_node.Attributes.Count, "#B3");
Assert.AreEqual (0, using_addressing_node.ChildNodes.Count, "#B4");
Assert.AreEqual (String.Empty, using_addressing_node.InnerText, "#B5");
}