locked
Can an alternative to the OData protocol be specified? RRS feed

  • Question

  • I have implemented a Custom Data Provider, based on this excellent blog, for a WCF Data Service. Out of the box the WCF Data Service complies to the OData protocol, can an alternative protocol be plugged in at runtime? I need to comply to 2 protocols, the OData protocol and a proprietary in-house protocol. The two differ in the number of segments in the URI template and their payload contents, i.e. how the datacontext is serialized.

    Basically I want to handle how the request is handled based on the Uri template. Are there any appropriate extension points that I can extend / override?

    Any help would be appreciated.

    Saturday, March 26, 2011 11:48 AM

Answers

  • Hi, 

    I am afraid we cannot specify other protocol for WCF Data Services.  WCF Data Services is REST based services which is built on top of OData Protocol.   You may do some customization on WCF services, but I am quite sure about it.  Maybe try WCF forum for some ideas.

    Pam

    Monday, March 28, 2011 2:30 AM
  • As noted by Pam, currently there's not support for custom formats in WCF Data Service implementation. It is possible to do something using WCF processing pipeline, but it's quite hard and not very performant.

    If your other format is very different from what OData uses (either ATOM or JSON), then I would probably suggest using a different end point, for whic you could use plain WCF REST service and handle all the requests yourself.

    Thanks,


    Vitek Karas [MSFT]
    Monday, March 28, 2011 7:59 AM
    Moderator

All replies

  • Hi, 

    I am afraid we cannot specify other protocol for WCF Data Services.  WCF Data Services is REST based services which is built on top of OData Protocol.   You may do some customization on WCF services, but I am quite sure about it.  Maybe try WCF forum for some ideas.

    Pam

    Monday, March 28, 2011 2:30 AM
  • As noted by Pam, currently there's not support for custom formats in WCF Data Service implementation. It is possible to do something using WCF processing pipeline, but it's quite hard and not very performant.

    If your other format is very different from what OData uses (either ATOM or JSON), then I would probably suggest using a different end point, for whic you could use plain WCF REST service and handle all the requests yourself.

    Thanks,


    Vitek Karas [MSFT]
    Monday, March 28, 2011 7:59 AM
    Moderator