locked
Cannot get data out of a WCF Data Service RRS feed

  • Question

  • I set up a WCF Data Service http://localhost:65432/YeagerTechWcfService.svc and when I run it, I get the expected output below:


    < ?xml version="1.0" encoding="UTF-8" standalone="true"?>
    -<service xmlns="http://www.w3.org/2007/app" xmlns:app="http://www.w3.org/2007/app" xmlns:atom="http://www.w3.org/2005/Atom" xml:base="http://localhost:65432/YeagerTechWcfService.svc/"> -<workspace> <atom:title>Default</atom:title> -<collection href="Categories"> <atom:title>Categories</atom:title> </collection> -<collection href="Customers"> <atom:title>Customers</atom:title> </collection> -<collection href="Priorities"> <atom:title>Priorities</atom:title> </collection> -<collection href="Projects"> <atom:title>Projects</atom:title> </collection> -<collection href="Status"> <atom:title>Status</atom:title> </collection> -<collection href="TimeTrackings"> <atom:title>TimeTrackings</atom:title> </collection> </workspace> </service>

     

    However, after executing the below method, I'm getting a js runtime error in the script:httpErrorPagesScripts.js when testing it out via the browser:

    var bElement = document.createElement("A");
    bElement.innerText = L_GOBACK_TEXT ;
    bElement.href = "javascript:history.back();";
    goBackContainer.appendChild(bElement);

    The method that is executing is below after I put in the following query: http://localhost:65432/YeagerTechWcfService.svc/Customers

            public QueryOperationResponse<Customer> GetCustomers()
            {
                YeagerTechEntities DbContext = new YeagerTechEntities();
     
                YeagerTechModel.YeagerTechEntities db = new YeagerTechModel.YeagerTechEntities();
     
                DataServiceQuery<Customer> query = (DataServiceQuery<Customer>)
                        from customer in db.Customers
                            where customer.CustomerID > 0
                            select customer;
     
                QueryOperationResponse<Customer> items = (QueryOperationResponse<Customer>)query.Execute();
     
                db.Dispose();
     
                return items;
            }
    Even if I set a breakpoint in the above method, it doesn't stop there. I just know that after I submit the query on the address bar, 
    it goes into this method, and then pops out and executes that js error.
    I'm sure that I'm missing something..... Can someone help?

     


    Bill Yeager
    Thursday, October 6, 2011 1:09 AM

All replies

  • Check if the data fetched is execeeding the limit. That might be causing the dynamic page to fail. Try reducing the number of rows fetched (in the source). Also try the below registry key(create if does not exist already)

    +HKEY_LOCAL_MACHINE or HKEY_CURRENT_USER>+SOFTWARE>>+Microsoft>>>+Feeds>>>> MaxFeedSize (REG_DWORD)

    set it to a high number like 128MB (0x08000000, 134217728), again depends on how much data is getting fetched.


    Please mark as answered if this solves the issue.
    • Edited by Harry2MS Friday, October 7, 2011 1:57 AM
    • Proposed as answer by Harry2MS Friday, October 7, 2011 1:59 AM
    • Marked as answer by Alan_chenModerator Tuesday, October 18, 2011 1:55 AM
    • Unmarked as answer by Bill_Yeager Tuesday, October 18, 2011 3:14 PM
    Friday, October 7, 2011 1:56 AM
  • There is only 1 record coming back from the database, so the number of rows fetched is not an issue...

    Note that this same type of query is successfully executed against an EF ORM model with a regular WCF Application Service. It's just that when I try to apply the same query using a WCF Data Service, I'm getting the error.


    Bill Yeager
    Friday, October 7, 2011 7:29 PM
  • Hi Bill,

    I think you can try to press F5 to debug your service(start) then input the URL in the web brower, your project will stop at the breakpoint.

    Have a nice day.


    Alan Chen[MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Tuesday, October 11, 2011 8:04 AM
    Moderator
  • Hi Bill

    Did you solve this issue? How?

    I am getting same error for my application.

    Thanks

    Saturday, August 4, 2012 6:32 PM