Home
Options

Odata MaxProtocolVersion supported

I am a very happy user of the free Linqpad. I am developing an Odata server
(version 3)and am getting this error:

The response version is 3.0, but the MaxProtocolVersion of the data service
context is set to V2. Set the MaxProtocolVersion to the version required by
the response, and then retry the request. If the client does not support the
required protocol version, then upgrade the client.

I guess this is due to the library used by Linqpad. If I upgraded to the
paid version would it support V3 (assuming my diagnostics are correct)

Comments

  • Options
    LINQPad uses the EntityClassGenerator class to generate the client proxy code. I've examined its output, and it does appear to call DataServiceContext's base constructor specifying a MaxProtocolVersion of 3.0, if the server supports it.

    Could there by anything in the way you've set up the server that could fail to indicate to EntityClassGenerator that V3 is supported? I'm guessing it's gleaning something from the metadata.
  • Options
    Tracing the invocation using Fiddler, the request from Linqpad to the server is:

    GET http://192.168.1.98:8088/odata2.svc/Patriarch()?$top=100 HTTP/1.1
    DataServiceVersion: 1.0;NetFx
    MaxDataServiceVersion: 2.0;NetFx
    Accept: application/atom+xml,application/xml
    Accept-Charset: UTF-8
    User-Agent: Microsoft ADO.NET Data Services
    Host: 192.168.1.98:8088
    Connection: Keep-Alive

    However it might be that EntityClassGenerator has decided based upon the metadata that this is the maximum provided and adjusted accordingly. I will investigate that and get back to you,

    Many thanks
  • Options
    FYI: The similar request from MS PowerQuery does specify a MaxDataServiceVersion of 3

    GET http://192.168.1.98:8088/odata2.svc/Gender?$top=1000 HTTP/1.1
    MaxDataServiceVersion: 3.0
    User-Agent: Mozilla/5.0 (compatible; Microsoft.Data.Mashup; http://go.microsoft.com/fwlink/?LinkID=304225)
    Accept: application/atom+xml;q=0.8,application/xml;q=0.7
    Host: 192.168.1.98:8088
    Accept-Encoding: gzip
    Connection: Keep-Alive

    Never the less I will continuing checking out the server. There seems to be quit a few subtle changes between Odata V2 and V3, and I am capable of making all the mistakes possible!
  • Options
    FYI the error was in the metadata generated by the server. Although it was generating m:DataServiceVersion of 3.0, it appears that this was insufficient for a WCF client to request 3.0. Adding a m:MaxDataServiceVersion of 3.0 solved the issue. Linqpad now requests a dataservice of 3.0 :

    DataServiceVersion: 1.0;NetFx
    MaxDataServiceVersion: 3.0;NetFx
  • Options
    Thanks for the info.
Sign In or Register to comment.