-
Notifications
You must be signed in to change notification settings - Fork 158
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error reading multipart Batch Response #1276
Comments
Is there a particular reason why you are not using the native OData client to read the OData payloads? I'd recommend using that if you can, otherwise you are going to be reinventing the wheel a lot. |
Hello @julealgon , in the last years i wrote a no relational provider for entityframework core for a custom protocol. Another reason is that OData Client returns already instanciated objects, I not need this, it is redundant because the object creation and properties assignments are made in the efcore shaper, I will be forced to generate all objects twice. |
Thanks for clarifying @GLuca74 , sounds like you have a fairly low-level, advanced case. I know this doesn't necessarily answer your specific question, but have you tried using JSON OData batch request/responses instead of the raw multipart request approach? That format should be substantially simpler to parse as it returns a single JSON object like a normal API would. |
good morning @julealgon, yes, I saw that option and it is very confortable, but it was introduced in OData 4.01. This means that if i choice that way, I will be not able to use my provider with older version. Other OData servers may not implement this feature. I prefer try to implement the multipart rappresentation first, this gives me a wider range of use of my provider. |
Hi @GLuca74. it was introduced in OData 4.01 - I don't believe this statement statement is valid. Json batch requests and responses are supported in OData V4 |
Hi @gathogojr , I read this : https://docs.oasis-open.org/odata/new-in-odata/v4.01/cn04/new-in-odata-v4.01-cn04.html#_Toc21700090 "8.11 New: JSON Batch Requests and Responses Version 4.01 introduces an alternative JSON format for batch requests and responses, so clients can now use off-the-shelf JSON libraries to compose batch requests and consume batch responses. Combined with the CSDL JSON representation [OData-CSDLJSON] this allows pure JSON communication with OData 4.01 services." |
Hello, I am trying to build an OData server using Microsoft.AspnetCore.OData.
I have a problem when I try to send a Batch request with a multipart request. The problem seems happend in the response.
In this repository,
https://github.com/GLuca74/TestOData
, there is a solution with 3 projects :TestODataServer - The server
TestODataClient - The client
TestODataModels - A shared Entity
the client request is processed by the server and it is able to receive the response, but when I try to read the actual response I get an error.
To read the response I use Microsoft.AspNet.WebApi.Client.
This is the code :
The exception is :
sniffing request and response with Fiddler, i have this :
It seems that ReadAsHttpResponseMessageAsync not like this
I tryed in a custom
ODataBatchHandler
to found a way to addmsgtype=response
to the response but i wanst able to found if is possible and whereI also tryed to use
Microsoft.OData.Client
and it works without problems, but I can not use this library.Can you help me found a solution?
The text was updated successfully, but these errors were encountered: