Esempio n. 1
0
        FindResponse Find(FindCriteria criteria)
        {
            var req = new MessageContracts11.FindRequest()
            {
                Body = new FindCriteria11(criteria)
            };

            Channel.BeginFind(req, delegate(IAsyncResult result) {
                Channel.EndFind(result);
            }, null);

            if (!reply_find_handle.WaitOne(InnerChannel.OperationTimeout))
            {
                throw new EndpointNotFoundException("The discovery client could not receive Find operation response within the operation timeout.");
            }
            try {
                var ir  = find_completed();
                var ret = new FindResponse();
                foreach (var fr in ir.Body)
                {
                    ret.Endpoints.Add(fr.ToEndpointDiscoveryMetadata());
                }
                return(ret);
            } finally {
                find_completed = null;
            }
        }
        public IAsyncResult BeginFind(FindCriteria criteria, AsyncCallback callback, object state)
        {
            var req = new MessageContracts11.FindRequest()
            {
                Body = new FindCriteria11(criteria)
            };

            return(Channel.BeginFind(req, callback, state));
        }