Ejemplo n.º 1
0
        private EdmSchema RequestMetadata()
        {
            var requestBuilder = new CommandRequestBuilder(_urlBase);
            var command        = HttpCommand.Get("$metadata");

            requestBuilder.AddCommandToRequest(command);
            using (var response = new CommandRequestRunner().TryRequest(command.Request))
            {
                if (response.StatusCode == HttpStatusCode.OK)
                {
                    return(ODataHelper.GetSchema(response.GetResponseStream()));
                }
            }
            // TODO
            return(null);
        }
Ejemplo n.º 2
0
 private string RequestMetadataAsString(string urlBase, ICredentials credentials = null)
 {
     var requestBuilder = new CommandRequestBuilder(urlBase, credentials);
     var command = HttpCommand.Get(ODataCommand.MetadataLiteral);
     requestBuilder.AddCommandToRequest(command);
     using (var response = new CommandRequestRunner(new ODataClientSettings()).ExecuteRequest(command.Request))
     {
         if (response.StatusCode == HttpStatusCode.OK)
         {
             return new ODataFeedReader().GetSchemaAsString(response.GetResponseStream());
         }
     }
     // TODO
     return null;
 }
Ejemplo n.º 3
0
 private string RequestMetadataAsString(string urlBase)
 {
     var requestBuilder = new CommandRequestBuilder(urlBase);
     var command = HttpCommand.Get("$metadata");
     requestBuilder.AddCommandToRequest(command);
     using (var response = new CommandRequestRunner().TryRequest(command.Request))
     {
         if (response.StatusCode == HttpStatusCode.OK)
         {
             return ODataHelper.GetSchemaAsString(response.GetResponseStream());
         }
     }
     // TODO
     return null;
 }