Exemplo n.º 1
0
        /// <summary>
        ///
        /// Encapsulate the oodss client requst in a simpler GetMetadata call.
        /// </summary>
        /// <param name="url"></param>
        /// <returns></returns>
        public async Task <Document> RequestMetadata(ParsedUri uri)
        {
            Document result = null;

            if (_metadataClient != null)
            {
                Debug.WriteLine("Performing asynchronous call");
                ResponseMessage metadataResponse =
                    _metadataClient.RequestAsync(new MetadataRequest(uri.ToString())).Result;
                Debug.WriteLine("Received asynchronous request ");

                if (metadataResponse != null && metadataResponse is MetadataResponse)
                {
                    result = (metadataResponse as MetadataResponse).Metadata;
                }
                else if (metadataResponse != null && metadataResponse is SemanticServiceError)
                {
                    (metadataResponse as SemanticServiceError).Perform();
                }
                else
                {
                    throw new Exception();
                }
            }
            else
            {
                var requestUri = new ParsedUri(_serviceBaseUri, "?url=" + uri.AbsoluteUri);
                result = await _metadataTypeScope.DeserializeUri(requestUri, Format.Xml) as Document;
            }

            return(result);
        }
        public void SendMessage(string message)
        {
            ChatRequest chatRequest = new ChatRequest(message);

            _client.RequestAsync(chatRequest);
            Console.WriteLine("---------me------->" + message);
            Console.WriteLine();
        }
Exemplo n.º 3
0
        public async Task <ResponseMessage> SendMessage(string message)
        {
            var request = new TestServiceRequest(message);

            return(await _client.RequestAsync(request));
        }