示例#1
0
        internal static ToHeader ReadHeader(XmlDictionaryReader reader, AddressingVersion version, UriCache uriCache,
                                            string actor, bool mustUnderstand, bool relay)
        {
            Uri to = ReadHeaderValue(reader, version, uriCache);

            if (actor.Length == 0 && mustUnderstand == mustUnderstandValue && !relay)
            {
                if ((object)to == (object)version.AnonymousUri)
                {
                    if (version == AddressingVersion.WSAddressing10)
                    {
                        return(AnonymousTo10);
                    }
                    else
                    {
                        throw new PlatformNotSupportedException($"Unsupported addressing version {version}");
                    }
                    //return AnonymousTo200408;
                }
                else
                {
                    return(new ToHeader(to, version));
                }
            }
            else
            {
                return(new FullToHeader(to, actor, mustUnderstand, relay, version));
            }
        }
示例#2
0
        internal static Uri ReadHeaderValue(XmlDictionaryReader reader, AddressingVersion version, UriCache uriCache)
        {
            Fx.Assert(reader.IsStartElement(XD.AddressingDictionary.To, version.DictionaryNamespace), "");

            string toString = reader.ReadElementContentAsString();

            if ((object)toString == (object)version.Anonymous)
            {
                return(version.AnonymousUri);
            }

            if (uriCache == null)
            {
                return(new Uri(toString));
            }

            return(uriCache.CreateUri(toString));
        }