public ResolveResponse Resolve(ResolveCriteria criteria)
        {
            var req = new MessageContractsApril2005.ResolveRequest()
            {
                Body = new ResolveCriteriaApril2005(criteria)
            };

            Channel.BeginResolve(req, delegate(IAsyncResult result) {
                Channel.EndResolve(result);
            }, null);

            var timeout = InnerChannel.OperationTimeout < criteria.Duration ? InnerChannel.OperationTimeout : criteria.Duration;

            if (!reply_find_handle.WaitOne(timeout))
            {
                throw new TimeoutException();
            }
            try {
                var ir       = resolve_completed();
                var metadata = ir.Body.ToEndpointDiscoveryMetadata();
                var sequence = ir.MessageSequence.ToDiscoveryMessageSequence();
                return(new ResolveResponse(metadata, sequence));
            } finally {
                resolve_completed = null;
            }
        }
        public IAsyncResult BeginResolve(ResolveCriteria criteria, AsyncCallback callback, object state)
        {
            var req = new MessageContractsApril2005.ResolveRequest()
            {
                Body = new ResolveCriteriaApril2005(criteria)
            };

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