private bool TryImportDeliveryAssurance(MetadataImporter importer, XmlElement node) { string ns = "http://docs.oasis-open.org/ws-rx/wsrmp/200702"; if (!ReliableSessionBindingElementImporter.IsElement(node, ns, "DeliveryAssurance")) { return(false); } IEnumerator nodes = node.ChildNodes.GetEnumerator(); XmlElement element = ReliableSessionBindingElementImporter.ThrowIfNotPolicyElement(ReliableSessionBindingElementImporter.SkipToNode(nodes), ReliableMessagingVersion.WSReliableMessaging11); foreach (IEnumerable <XmlElement> enumerable2 in importer.NormalizePolicy(new XmlElement[] { element })) { ReliableSessionBindingElementImporter.State assurance = ReliableSessionBindingElementImporter.State.Assurance; foreach (XmlElement element2 in enumerable2) { switch (assurance) { case ReliableSessionBindingElementImporter.State.Assurance: { assurance = ReliableSessionBindingElementImporter.State.Order; if ((!ReliableSessionBindingElementImporter.IsElement(element2, ns, "ExactlyOnce") && !ReliableSessionBindingElementImporter.IsElement(element2, ns, "AtMostOnce")) && !ReliableSessionBindingElementImporter.IsElement(element2, ns, "AtMostOnce")) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidChannelBindingException(System.ServiceModel.SR.GetString("DeliveryAssuranceRequired", new object[] { ns, element2.LocalName, element2.NamespaceURI }))); } continue; } case ReliableSessionBindingElementImporter.State.Order: assurance = ReliableSessionBindingElementImporter.State.Done; if (ReliableSessionBindingElementImporter.IsElement(element2, ns, "InOrder")) { if (!this.isOrdered) { this.isOrdered = true; } continue; } break; } throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidChannelBindingException(System.ServiceModel.SR.GetString("UnexpectedXmlChildNode", new object[] { element2.LocalName, element2.NodeType, "DeliveryAssurance" }))); } if (assurance == ReliableSessionBindingElementImporter.State.Assurance) { string message = System.ServiceModel.SR.GetString("DeliveryAssuranceRequiredNothingFound", new object[] { ns }); throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidChannelBindingException(message)); } } System.Xml.XmlNode node2 = ReliableSessionBindingElementImporter.SkipToNode(nodes); if (node2 != null) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidChannelBindingException(System.ServiceModel.SR.GetString("UnexpectedXmlChildNode", new object[] { node2.LocalName, node2.NodeType, node.LocalName }))); } return(true); }
private bool TryImportSequenceSTR(XmlElement node) { string ns = "http://docs.oasis-open.org/ws-rx/wsrmp/200702"; if (ReliableSessionBindingElementImporter.IsElement(node, ns, "SequenceSTR")) { return(true); } if (ReliableSessionBindingElementImporter.IsElement(node, ns, "SequenceTransportSecurity")) { this.hasValidPolicy = false; return(true); } return(false); }