public void ByeOperationAsync(EndpointDiscoveryMetadata endpointDiscoveryMetadata, object userState)
        {
            ByeMessageCD1 message = ByeMessageCD1.Create(DiscoveryMessageSequenceGenerator.Next(), endpointDiscoveryMetadata);

            if (this.onBeginByeOperationDelegate == null)
            {
                this.onBeginByeOperationDelegate = new BeginOperationDelegate(this.OnBeginByeOperation);
            }
            if ((this.onEndByeOperationDelegate == null))
            {
                this.onEndByeOperationDelegate = new EndOperationDelegate(this.OnEndByeOperation);
            }
            if ((this.onByeOperationCompletedDelegate == null))
            {
                this.onByeOperationCompletedDelegate = Fx.ThunkCallback(new SendOrPostCallback(this.OnByeOperationCompleted));
            }
            base.InvokeAsync(
                this.onBeginByeOperationDelegate,
                new object[] { message },
                this.onEndByeOperationDelegate,
                this.onByeOperationCompletedDelegate,
                userState);
        }
        public IAsyncResult BeginByeOperation(EndpointDiscoveryMetadata endpointDiscoveryMetadata, AsyncCallback callback, object state)
        {
            ByeMessageCD1 message = ByeMessageCD1.Create(DiscoveryMessageSequenceGenerator.Next(), endpointDiscoveryMetadata);

            return(base.Channel.BeginByeOperation(message, callback, state));
        }
        public void ByeOperation(EndpointDiscoveryMetadata endpointDiscoveryMetadata)
        {
            ByeMessageCD1 message = ByeMessageCD1.Create(DiscoveryMessageSequenceGenerator.Next(), endpointDiscoveryMetadata);

            base.Channel.ByeOperation(message);
        }
예제 #4
0
        /// <summary>
        /// Loads all announcement messages from file into list.
        /// </summary>
        /// <param name="list">Reference to a list</param>
        /// <param name="path">Path to xml file</param>
        public static void LoadMessages(List <Tuple <DiscoveryMessageSequence, EndpointDiscoveryMetadata> > list, string path)
        {
            MethodInfo loadEndpoint = typeof(EndpointDiscoveryMetadata).GetMethods(BindingFlags.Instance | BindingFlags.NonPublic).First((x) => "ReadFrom" == x.Name);
            DiscoveryMessageSequenceGenerator gen = new DiscoveryMessageSequenceGenerator();

            using (XmlReader reader = XmlReader.Create(path))
            {
                while (reader.ReadToFollowing("Envelope", "http://www.w3.org/2003/05/soap-envelope"))
                {
                    using (Message msg = Message.CreateMessage(reader, Int16.MaxValue, MessageVersion.Soap12))
                    {
                        EndpointDiscoveryMetadata data = new EndpointDiscoveryMetadata();

                        loadEndpoint.Invoke(data, new object[] { DiscoveryVersion.WSDiscovery11, msg.GetReaderAtBodyContents() });

                        list.Add(new Tuple <DiscoveryMessageSequence, EndpointDiscoveryMetadata>(gen.Next(), data));
                    }
                }
            }
        }
예제 #5
0
        public void HelloOperation(EndpointDiscoveryMetadata endpointDiscoveryMetadata)
        {
            HelloMessage11 message = HelloMessage11.Create(DiscoveryMessageSequenceGenerator.Next(), endpointDiscoveryMetadata);

            base.Channel.HelloOperation(message);
        }
        public IAsyncResult BeginHelloOperation(EndpointDiscoveryMetadata endpointDiscoveryMetadata, AsyncCallback callback, object state)
        {
            HelloMessageApril2005 message = HelloMessageApril2005.Create(DiscoveryMessageSequenceGenerator.Next(), endpointDiscoveryMetadata);

            return(base.Channel.BeginHelloOperation(message, callback, state));
        }