1. Download the repro project.
2. Make it compile and run. (Point it to your system.web.http.odata dll)
3. A web page will open when you run the solution.
4. Enable all the exceptions when debugging.
5. Click run.
Request sent by the client:
GET http://localhost:26000/Values HTTP/1.1
Accept: application/atomsvc+xml;q=0.8, application/json;odata=fullmetadata;q=0.7, application/json;q=0.5, */*;q=0.1
MaxDataServiceVersion: 2.0
Referer: http://localhost:21356/Datajs.html
Accept-Language: en-US
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; WOW64; Trident/6.0)
Host: localhost:26000
DNT: 1
Connection: Keep-Alive
Stacktace:
Microsoft.Data.OData.ODataContentTypeException occurred
HResult=-2146233079
Message=A supported MIME type could not be found that matches the acceptable MIME types for the request. The supported type(s) 'application/atom+xml;type=feed, application/atom+xml, application/json;odata=verbose, application/json' do not match any of the acceptable MIME types 'application/json; odata=fullmetadata; charset=utf-8'.
Source=Microsoft.Data.OData
StackTrace:
at Microsoft.Data.OData.MediaTypeUtils.GetContentTypeFromSettings(ODataMessageWriterSettings settings, ODataPayloadKind payloadKind, MediaTypeResolver mediaTypeResolver, MediaType& mediaType, Encoding& encoding)
at Microsoft.Data.OData.ODataMessageWriter.EnsureODataFormatAndContentType()
at Microsoft.Data.OData.ODataMessageWriter.SetHeaders(ODataPayloadKind payloadKind)
at Microsoft.Data.OData.ODataMessageWriter.SetOrVerifyHeaders(ODataPayloadKind payloadKind)
at Microsoft.Data.OData.ODataMessageWriter.WriteToOutput[TResult](ODataPayloadKind payloadKind, Action verifyHeaders, Func`2 writeFunc)
at Microsoft.Data.OData.ODataMessageWriter.CreateODataFeedWriter(IEdmEntitySet entitySet, IEdmEntityType entityType)
at System.Web.Http.OData.Formatter.Serialization.ODataFeedSerializer.WriteObject(Object graph, ODataMessageWriter messageWriter, ODataSerializerContext writeContext) in c:\work\aspnetwebstack\src\System.Web.Http.OData\OData\Formatter\Serialization\ODataFeedSerializer.cs:line 66
InnerException:
when you click run, it will simply query for a feed using jaydata library and it will fail.
2. Make it compile and run. (Point it to your system.web.http.odata dll)
3. A web page will open when you run the solution.
4. Enable all the exceptions when debugging.
5. Click run.
Request sent by the client:
GET http://localhost:26000/Values HTTP/1.1
Accept: application/atomsvc+xml;q=0.8, application/json;odata=fullmetadata;q=0.7, application/json;q=0.5, */*;q=0.1
MaxDataServiceVersion: 2.0
Referer: http://localhost:21356/Datajs.html
Accept-Language: en-US
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; WOW64; Trident/6.0)
Host: localhost:26000
DNT: 1
Connection: Keep-Alive
Stacktace:
Microsoft.Data.OData.ODataContentTypeException occurred
HResult=-2146233079
Message=A supported MIME type could not be found that matches the acceptable MIME types for the request. The supported type(s) 'application/atom+xml;type=feed, application/atom+xml, application/json;odata=verbose, application/json' do not match any of the acceptable MIME types 'application/json; odata=fullmetadata; charset=utf-8'.
Source=Microsoft.Data.OData
StackTrace:
at Microsoft.Data.OData.MediaTypeUtils.GetContentTypeFromSettings(ODataMessageWriterSettings settings, ODataPayloadKind payloadKind, MediaTypeResolver mediaTypeResolver, MediaType& mediaType, Encoding& encoding)
at Microsoft.Data.OData.ODataMessageWriter.EnsureODataFormatAndContentType()
at Microsoft.Data.OData.ODataMessageWriter.SetHeaders(ODataPayloadKind payloadKind)
at Microsoft.Data.OData.ODataMessageWriter.SetOrVerifyHeaders(ODataPayloadKind payloadKind)
at Microsoft.Data.OData.ODataMessageWriter.WriteToOutput[TResult](ODataPayloadKind payloadKind, Action verifyHeaders, Func`2 writeFunc)
at Microsoft.Data.OData.ODataMessageWriter.CreateODataFeedWriter(IEdmEntitySet entitySet, IEdmEntityType entityType)
at System.Web.Http.OData.Formatter.Serialization.ODataFeedSerializer.WriteObject(Object graph, ODataMessageWriter messageWriter, ODataSerializerContext writeContext) in c:\work\aspnetwebstack\src\System.Web.Http.OData\OData\Formatter\Serialization\ODataFeedSerializer.cs:line 66
InnerException:
when you click run, it will simply query for a feed using jaydata library and it will fail.