You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
at Microsoft.OData.JsonLight.ODataJsonLightContextUriParser.ParseContextUriFragment(String fragment, Func3 clientCustomTypeResolver, Boolean throwIfMetadataConflict, Boolean& isUndeclared) at Microsoft.OData.JsonLight.ODataJsonLightContextUriParser.ParseContextUri(ODataPayloadKind expectedPayloadKind, Func3 clientCustomTypeResolver, Boolean throwIfMetadataConflict)
at Microsoft.OData.JsonLight.ODataJsonLightContextUriParser.Parse(IEdmModel model, String contextUriFromPayload, ODataPayloadKind payloadKind, Func3 clientCustomTypeResolver, Boolean needParseFragment, Boolean throwIfMetadataConflict) at Microsoft.OData.JsonLight.ODataJsonLightDeserializer.ReadPayloadStart(ODataPayloadKind payloadKind, PropertyAndAnnotationCollector propertyAndAnnotationCollector, Boolean isReadingNestedPayload, Boolean allowEmptyPayload) at Microsoft.OData.JsonLight.ODataJsonLightReader.ReadAtStartImplementation() at Microsoft.OData.ODataReaderCore.ReadImplementation() at Microsoft.OData.ODataReaderCore.ReadSynchronously() at Microsoft.OData.ODataReaderCore.InterceptException[T](Func1 action)
at Microsoft.OData.ODataReaderCore.Read()
at Simple.OData.Client.V4.Adapter.ResponseReader.ReadResponse(ODataReader odataReader, IODataResponseMessageAsync responseMessage)
at Simple.OData.Client.V4.Adapter.ResponseReader.d__3.MoveNext()
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable1.ConfiguredTaskAwaiter.GetResult() at Simple.OData.Client.ODataClient.<ExecuteRequestWithResultAsync>d__1471.MoveNext()
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable1.ConfiguredTaskAwaiter.GetResult() at Simple.OData.Client.ODataClient.<FindAnnotatedEntriesAsync>d__88.MoveNext() at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.ConfiguredTaskAwaitable1.ConfiguredTaskAwaiter.GetResult()
at Simple.OData.Client.ODataClient.d__89.MoveNext()
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable1.ConfiguredTaskAwaiter.GetResult() at Simple.OData.Client.FluentClientBase2.d__91.MoveNext()
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at WcbsApiTest.Program.d__3.MoveNext() in D:\Code\ScratchPad\OAuth2\WcbsApiTest\WcbsApiTest\Program.cs:line 117
The calling code is:
public static async Task GetSchoolsAsync(string authToken)
{
var httpClient = new HttpClient
{
BaseAddress = new Uri("https://xxx.xxx-xxx.co.uk/")
};
httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", authToken);
var client = new ODataClient(new ODataClientSettings(httpClient, new Uri("api", UriKind.Relative))
{
IgnoreResourceNotFoundException = true,
OnTrace = (x, y) => Console.WriteLine(string.Format(x, y))
});
try
{
//var schools = await client.For("Schools").FindEntriesAsync();
var schools = await client.For<School>().FindEntriesAsync();
foreach (var school in schools)
{
Console.WriteLine(school.Description);
}
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
throw;
}
}
I have tried both the typed and untyped syntax and the error is the same.
The above code works with OData reference services.
Hi,
when connecting to and querying the api for our MIS system I get the following error:
The full stack trace is:
The calling code is:
I have tried both the typed and untyped syntax and the error is the same.
The above code works with OData reference services.
Sample response from the service:
The text was updated successfully, but these errors were encountered: