コード例 #1
0
        protected override void OnWriteBodyContents(XmlDictionaryWriter writer)
        {
            WsrmFeb2005Dictionary dictionary   = XD.WsrmFeb2005Dictionary;
            XmlDictionaryString   namespaceUri = WsrmIndex.GetNamespace(this.reliableMessagingVersion);

            writer.WriteStartElement(dictionary.CreateSequence, namespaceUri);
            EndpointAddress localAddress = this.binder.LocalAddress;

            localAddress.WriteTo(this.addressingVersion, writer, dictionary.AcksTo, namespaceUri);
            if (this.offerIdentifier != null)
            {
                writer.WriteStartElement(dictionary.Offer, namespaceUri);
                writer.WriteStartElement(dictionary.Identifier, namespaceUri);
                writer.WriteValue(this.offerIdentifier);
                writer.WriteEndElement();
                if (this.reliableMessagingVersion == ReliableMessagingVersion.WSReliableMessaging11)
                {
                    Wsrm11Dictionary dictionary2 = DXD.Wsrm11Dictionary;
                    localAddress.WriteTo(this.addressingVersion, writer, dictionary2.Endpoint, namespaceUri);
                    writer.WriteStartElement(dictionary2.IncompleteSequenceBehavior, namespaceUri);
                    writer.WriteValue(this.ordered ? dictionary2.DiscardFollowingFirstGap : dictionary2.NoDiscard);
                    writer.WriteEndElement();
                }
                writer.WriteEndElement();
            }
            ISecureConversationSession innerSession = this.binder.GetInnerSession() as ISecureConversationSession;

            if (innerSession != null)
            {
                innerSession.WriteSessionTokenIdentifier(writer);
            }
            writer.WriteEndElement();
        }
コード例 #2
0
ファイル: CreateSequence.cs プロジェクト: sveinfid-prospa/wcf
        protected override void OnWriteBodyContents(XmlDictionaryWriter writer)
        {
            WsrmFeb2005Dictionary wsrmFeb2005Dictionary = XD.WsrmFeb2005Dictionary;
            XmlDictionaryString   wsrmNs = WsrmIndex.GetNamespace(_reliableMessagingVersion);

            writer.WriteStartElement(wsrmFeb2005Dictionary.CreateSequence, wsrmNs);

            EndpointAddress localAddress = _binder.LocalAddress;

            localAddress.WriteTo(_addressingVersion, writer, wsrmFeb2005Dictionary.AcksTo, wsrmNs);

            if (_offerIdentifier != null)
            {
                writer.WriteStartElement(wsrmFeb2005Dictionary.Offer, wsrmNs);
                writer.WriteStartElement(wsrmFeb2005Dictionary.Identifier, wsrmNs);
                writer.WriteValue(_offerIdentifier);
                writer.WriteEndElement();

                if (_reliableMessagingVersion == ReliableMessagingVersion.WSReliableMessaging11)
                {
                    Wsrm11Dictionary wsrm11Dictionary = DXD.Wsrm11Dictionary;
                    localAddress.WriteTo(_addressingVersion, writer, wsrm11Dictionary.Endpoint, wsrmNs);

                    writer.WriteStartElement(wsrm11Dictionary.IncompleteSequenceBehavior, wsrmNs);
                    writer.WriteValue(
                        _ordered ? wsrm11Dictionary.DiscardFollowingFirstGap : wsrm11Dictionary.NoDiscard);
                    writer.WriteEndElement();
                }

                writer.WriteEndElement();
            }

            ISecureConversationSession securitySession = _binder.GetInnerSession() as ISecureConversationSession;

            if (securitySession != null)
            {
                securitySession.WriteSessionTokenIdentifier(writer);
            }

            writer.WriteEndElement();
        }