locked
$filter is not fully convert into expression RRS feed

Answers

  • Why would you map the same URI to different resources? something does not add up here, my honest opinion here is to re-examine your requirements and see if a Truely restful architecture is possible.

    That said, I understand for various reasons things had to be done some way. I don't think there are good resources on how to write a custom host, not a lot of people require that. But I think as a start you can simply inherit from WebServiceHost and implement that interface. It's been a while since I looked at this area of code so my memory could be wrong.


    Peter Q. http://blogs.msdn.com/peter_qian

    Friday, February 24, 2012 6:47 AM
    Answerer
  • Thanks, Peter, you are really helpful! I also find a similar post related on how to create the IDataServiceHost - http://blogs.msdn.com/b/tom_laird-mcconnell/archive/2010/01/18/using-ado-net-wcf-data-services-for-streaming-infinite-event-result-sets.aspx
    Friday, February 24, 2012 7:04 AM

All replies

  • The URi rewritting mechanism is only suppose to be used to rewrite the xml:base address and entity ID generations, it's for servers behind firewalls, etc. It does not alter the original query in any way.

    Instead, if you are absolutely sure injecting querystrings is the way to go, then you need your own custom DataServiceHost implementation, and override GetQueryStringItem:

    http://msdn.microsoft.com/en-us/library/system.data.services.idataservicehost.getquerystringitem.aspx

    What exactly is the reason that you cannot use a QueryInterceptor?

    Regards,

    PQ


    Peter Q. http://blogs.msdn.com/peter_qian

    Friday, February 24, 2012 6:05 AM
    Answerer
  • Thanks, Peter!

    We are using the modified URL as the resource identifier in our backend - same URL with different date will be different resource.  If we cannot use this URI, we have to think another way to identify it - Expression is not a good candidate since it's not intutive.

    It seems there will be a lot of work to create a custom service host - do you have some samples? or can I have easy solution to hajact the WCF hosting?

    Thanks a lot.

    Friday, February 24, 2012 6:16 AM
  • Why would you map the same URI to different resources? something does not add up here, my honest opinion here is to re-examine your requirements and see if a Truely restful architecture is possible.

    That said, I understand for various reasons things had to be done some way. I don't think there are good resources on how to write a custom host, not a lot of people require that. But I think as a start you can simply inherit from WebServiceHost and implement that interface. It's been a while since I looked at this area of code so my memory could be wrong.


    Peter Q. http://blogs.msdn.com/peter_qian

    Friday, February 24, 2012 6:47 AM
    Answerer
  • Thanks, Peter, you are really helpful! I also find a similar post related on how to create the IDataServiceHost - http://blogs.msdn.com/b/tom_laird-mcconnell/archive/2010/01/18/using-ado-net-wcf-data-services-for-streaming-infinite-event-result-sets.aspx
    Friday, February 24, 2012 7:04 AM