示例#1
0
        protected TransportOutputChannel(IDefaultCommunicationTimeouts timeouts, EndpointAddress to, Uri via, bool manualAddressing, MessageVersion messageVersion)
            : base(timeouts)
        {
            ManualAddressing = manualAddressing;
            MessageVersion   = messageVersion;
            _to  = to;
            _via = via;

            if (!manualAddressing && _to != null)
            {
                Uri toUri;
                if (_to.IsAnonymous)
                {
                    toUri = MessageVersion.Addressing.AnonymousUri;
                }
                else if (_to.IsNone)
                {
                    toUri = MessageVersion.Addressing.NoneUri;
                }
                else
                {
                    toUri = _to.Uri;
                }

                if (toUri != null)
                {
                    XmlDictionaryString dictionaryTo = new ToDictionary(toUri.AbsoluteUri).To;
                    _toHeader = ToHeader.Create(toUri, dictionaryTo, messageVersion.Addressing);
                }

                _anyHeadersToAdd = _to.Headers.Count > 0;
            }
        }
示例#2
0
        protected TransportOutputChannel(ChannelManagerBase channelManager, EndpointAddress to, Uri via, bool manualAddressing, MessageVersion messageVersion)
            : base(channelManager)
        {
            this.manualAddressing = manualAddressing;
            this.messageVersion   = messageVersion;
            this.to  = to;
            this.via = via;

            if (!manualAddressing && to != null)
            {
                Uri toUri;
                if (to.IsAnonymous)
                {
                    toUri = this.messageVersion.Addressing.AnonymousUri;
                }
                else if (to.IsNone)
                {
                    toUri = this.messageVersion.Addressing.NoneUri;
                }
                else
                {
                    toUri = to.Uri;
                }

                if (toUri != null)
                {
                    XmlDictionaryString dictionaryTo = new ToDictionary(toUri.AbsoluteUri).To;
                    toHeader = ToHeader.Create(toUri, dictionaryTo, messageVersion.Addressing);
                }

                anyHeadersToAdd = to.Headers.Count > 0;
            }
        }