WCF REST using ORM gives Internet Explorer cannot display webpage

Thread is closed for posting
2 posts, 0 answers
  1. Steve Woolley
    Steve Woolley avatar
    2 posts
    Member since:
    Feb 2010

    Posted 17 Feb 2010 Link to this post

    Am using:
    • OpenAccess ORM
    • Data Services Wizard (Beta)
    • WCF REST Starter Kit Preview 2
    • Visual Studio 2008

    I have a project going to REST enable some of our services. Our schema has a large hierarchy of objects (but no many-2-many relationships) that was Reverse Generated from a local SQL Express database. We use the "View in Browser" command to view our *.svc objects. We can display the correct schemas and examples using (for example):

    http://localhost:49547/Products.svc/help

    Objects that have no records (data) yet respond with the normal output of:

    <ItemInfoList xmlns:i="http://www.w3.org/2001/XMLSchema-instance" />

    However ON SOME PCs when an object that has data is displayed, Internet Explorer returns with a:

    Internet Explorer cannot display the webpage

    On some PCs, however, it works fine and displays the object data. We point at the same database and IF we fill in the ID for particular records (for example):

    http://localhost:49547/Products.svc/1                          <= exists in database

    returns:
    Internet Explorer cannot display the webpage

    http://localhost:49547/Products.svc/9999                    <= does not exist in database

    returns:
    Error Status Code:
    'NotFound'

    Details: NotFound

    So we believe that the service is accurately hitting the database.

    Our big point of confusion is why it works fine on some PCs and not on others using the same code and pointing at the same database. Since we are in the debugging stage of development, it is very hard to be productive without being able to display the output of our REST services without a browser. My first inclination is that it is a browser plugin or security/property setting inside Internet Explorer but on initial look I cannot find anything that looks different on the various PCs. One user has also stated that they have used chrome and firefox which gives the same results but I have yet to confirm this.

    Any one have any ideas?

    Steve Woolley
    swoolley@ardentsoft.com

  2. Peter Bahaa
    Admin
    Peter Bahaa avatar
    26 posts

    Posted 22 Feb 2010 Link to this post

    Hello Steve Woolley,

    You are having this issue because the amount of data injected in the response is out of the request payload limits. To verify that, you can go to the service code behind and in the GetItemsInXml methods change the code to:

    var data = this.dataManager.ReadEntities<DAL.Order>();
    if (data.Count > 10)
    {
        return data.Take(10).ToDictionary(r => Database.GetObjectId(r).ToString()).AsEnumerable();
    }
    else
    {
        return data.ToDictionary(r => Database.GetObjectId(r).ToString()).AsEnumerable();
    }

    If it is still not working, try to reduce the 10 items to 5, for example. So limits with REST payloads could be solved by paging, but REST collection services do not support this yet. We will add this enhancement to the generated service to support paging in next release. In the meantime you can write the limit condition shown above and try to call a WCF service to retrieve this specific entity data, as request limits are configurable when you are using a WCF endpoints service.

    Regards,

    Peter Bahaa
    the Telerik team


    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Back to Top