无法从WCF数据服务中获取数据 [英] Cannot get data out of a WCF Data Service

查看:90
本文介绍了无法从WCF数据服务中获取数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我设置了WCF数据服务 http:/ /localhost:65432/YeagerTechWcfService.svc  当我运行它时,我得到下面的预期输出:

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"编码= QUOT; UTF-8英寸standalone =" true"?>

- < service xmlns =" http://www.w3.org/2007/app " xmlns:app =" http://www.w3。组织/ 2007 /应用 "
xmlns:atom =" http:// www.w3.org/2005/Atom " xml:base =" http:// localhost:65432 / YeagerTechWcfService .SVC / ">
- < workspace> <原子:标题>默认< /原子:标题> - < collection href =" Categories"> <原子:标题>类别< /原子:标题> < /收集> - < collection href =" Customers"> <原子:标题>客户和LT; /原子:标题> < /收集>
- < collection href =" Priorities"> <原子:标题>优先级< /原子:标题> < /收集> - < collection href =" Projects"> <原子:标题>项目与LT; /原子:标题> < /收集> - < collection href =" Status"> <原子:标题>状态< /原子:标题>
< / collection> - < collection href =" TimeTrackings"> <原子:标题> TimeTrackings< /原子:标题> < /收集> < /工作区> < / service>


< ?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>

 

但是,执行以下方法后,我在脚本中遇到js运行时错误: httpErrorPagesScripts.js
在通过浏览器测试时:

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);

在我输入以下查询后,正在执行的方法如下:
http:// localhost:65432 / YeagerTechWcfService.svc / Customers

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?

 

推荐答案

检查提取的数据是否超出限制。这可能会导致动态页面失败。尝试减少获取的行数(在源中)。同时尝试以下注册表项(如果已经不存在则创建)

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或HKEY_CURRENT_USER> + SOFTWARE>> + Microsoft>>> + Feeds>>>> ; MaxFeedSize(REG_DWORD)

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

将其设置为128MB(0x08000000,1342728)等高位数,再次取决于获取的数据量。

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


这篇关于无法从WCF数据服务中获取数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆