locked
ADO.NET DataService - Entities with '/' in key field produced malformed urls for related entities RRS feed

  • Question

  • "../Costomers('Wind/Sea Ltd')"
    will have a link to orders of "Sea Ltd')/Orders"

    is there a way around this issue.

    Wednesday, April 22, 2009 11:54 AM

Answers

  • Hi again,

    Thanks for the info. I've been talking to some other team members, and none of us are able to reproduce the malformed href attribute.


    1) Can you share the metadata information for your service? Specifically, the edmx your EF model is using would be very informative.

    2) What sort of database are you using? Is it the SQL express instance that is installed by visual studio?

    3) What is the specific type of the id column in the database? (including any encoding/collation information)


    If you would rather just email me a zipped copy of your project and database, my email is 'mmeehan' at microsoft.


    By the way, there is a known issue with ADO.NET Data Services and URIs containing '/' (due to a deeper issue with System.Uri). However, this appears to be a separate issue given our inability to reproduce it.
    Matt Meehan, ADO.NET Data Services (Astoria)
    Thursday, April 23, 2009 11:30 PM
    Moderator

All replies

  • Since you use a string literal for the key value, this should be a problem.  What makes you think it is malformed?  Do you have a code snippet that demostrates an issue?  What is the error?
    Wednesday, April 22, 2009 1:08 PM
    Moderator
  • Look basicaly the link for related enttities seems to be created by taking everything after the last slash from the url of the current entity insted of building it up programaticaly, this is a bug, i except that ADODS is betaware im simply asking if there is a workaround so i can continue to evaluate this technology.


    <entry>
        <id>http://localhost:1667/MySrv.svc/Customers('Wind/Sea LTD')</id>
        <title type="text"></title>
        <updated>2009-04-22T13:21:55Z</updated>
        <author>
          <name />
        </author>
        <link rel="edit" title="Customers" href="Customers(''Wind/Sea LTD')" />
        <link rel="
    http://schemas.microsoft.com/ado/2007/08/dataservices/related/Orders" type="application/atom+xml;type=feed" title="Orders" href="Sea LTD')/Orders" />

    Wednesday, April 22, 2009 1:31 PM
  • Hi,

    I'm trying to repro this, and I haven't been able to get the same behavior you're seeing. I have a few questions:

    1) What was the request URI associated with the snippet above? I'm assuming it was a GET request, please correct me if not.

    2) What is the metadata for Customers and Orders?

    3) Are you using the Entity Framework-based provider or the CLR/Reflection-based provider?

    4) Are you using the 3.5 sp1 release of ADO.NET Data Services or the recent CTP?


    My service was a simple reflection-based service with a  string-keyed 'Thing' type with a collection of other 'Things'.

    Here is a snippet taken from a GET request to 'svc/Things':

    <entry>
        <id>http://localhost:51529/WebSite1/WebDataService.svc/Things('Test/Foo')</id>
        <title type="text"></title>
        <updated>2009-04-22T16:06:54Z</updated>
        <author>
          <name />
        </author>
        <link rel="edit" title="Thing" href="Things('Test/Foo')" />
        <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Things" type="application/atom+xml;type=feed" title="Things" href="Things('Test/Foo')/Things" />

    As you can see, the link to 'Things' is correct. It may be that the model I've cooked up is too simple to repro this issue. I'm currently working on a more accurate repro of the snippet you provided.

    Thanls.
    Matt Meehan, ADO.NET Data Services (Astoria)
    Wednesday, April 22, 2009 4:10 PM
    Moderator
  • 1)  "http://localhost:1667/MySrv.svc/Customers" GET
    2)
    3)
    Entity Framework
    4) dotnetfx35setup +
        ADONETDataServices_v15_CTP1 +
        EFToolsSetupX86 +
        VS90sp1-KB945140-ENU +
        VS90-KB945282 +
        All less than a couple of weeks ago

    I have basicaly just followed the intructions from the quick start instructions on my own existing database.
         

       

    Thursday, April 23, 2009 2:22 PM
  • Hi again,

    Thanks for the info. I've been talking to some other team members, and none of us are able to reproduce the malformed href attribute.


    1) Can you share the metadata information for your service? Specifically, the edmx your EF model is using would be very informative.

    2) What sort of database are you using? Is it the SQL express instance that is installed by visual studio?

    3) What is the specific type of the id column in the database? (including any encoding/collation information)


    If you would rather just email me a zipped copy of your project and database, my email is 'mmeehan' at microsoft.


    By the way, there is a known issue with ADO.NET Data Services and URIs containing '/' (due to a deeper issue with System.Uri). However, this appears to be a separate issue given our inability to reproduce it.
    Matt Meehan, ADO.NET Data Services (Astoria)
    Thursday, April 23, 2009 11:30 PM
    Moderator