为什么我的实体在部署后消失?
我为我们的几个实体创建了一个 OData 服务,在我的开发计算机 (WinXP) 上,一切都正常工作,这就是我访问该服务时得到的结果:
<?xml version="1.0" encoding="iso-8859-1" standalone="yes"?>
<service xml:base="http://localhost:2332/ContactOData.svc/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:app="http://www.w3.org/2007/app" xmlns="http://www.w3.org/2007/app">
<workspace>
<atom:title>Default</atom:title>
<collection href="Client">
<atom:title>Client</atom:title>
</collection>
<collection href="Vehicle">
<atom:title>Vehicle</atom:title>
</collection>
<collection href="Contact">
<atom:title>Contact</atom:title>
</collection>
</workspace>
</service>
现在,在我将该服务部署到测试服务器 (Win2K3) 后,我的所有实体都消失了:
<?xml version="1.0" encoding="iso-8859-1" standalone="yes"?>
<service xml:base="http://dev-cont2011b/ContactOData/ContactOData.svc/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:app="http://www.w3.org/2007/app" xmlns="http://www.w3.org/2007/app">
<workspace>
<atom:title>Default</atom:title>
</workspace>
</service>
没有错误消息,事件日志中没有任何内容。我的连接字符串没问题(我用一个简单的 test.aspx
页面对此进行了测试,该页面从数据库中获取一些内容并将其显示在页面上==>这有效)。
当我手动输入其中一个实体(客户端)的 url 时,我得到的是:
<?xml version="1.0" encoding="iso-8859-1" standalone="yes"?>
<error xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
<code></code>
<message xml:lang="nl-BE">Resource not found for the segment 'Client'.</message>
</error>
.NET Framework 3.5 安装在该服务器上。我运行了所有更新。
在过去的几个小时里,我一直在为这个问题苦苦思索。我不知道我还能做什么或测试什么。
有什么建议吗?
I created an OData service for a couple of our entities, and on my developer machine (WinXP), everything works like it should, this is what I get when accessing the service:
<?xml version="1.0" encoding="iso-8859-1" standalone="yes"?>
<service xml:base="http://localhost:2332/ContactOData.svc/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:app="http://www.w3.org/2007/app" xmlns="http://www.w3.org/2007/app">
<workspace>
<atom:title>Default</atom:title>
<collection href="Client">
<atom:title>Client</atom:title>
</collection>
<collection href="Vehicle">
<atom:title>Vehicle</atom:title>
</collection>
<collection href="Contact">
<atom:title>Contact</atom:title>
</collection>
</workspace>
</service>
Now after I deployed that service to a testserver (Win2K3), all my entities are gone:
<?xml version="1.0" encoding="iso-8859-1" standalone="yes"?>
<service xml:base="http://dev-cont2011b/ContactOData/ContactOData.svc/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:app="http://www.w3.org/2007/app" xmlns="http://www.w3.org/2007/app">
<workspace>
<atom:title>Default</atom:title>
</workspace>
</service>
There are no error messages, nothing in the event log. My connections string is ok (I tested this with a simple test.aspx
page which fetches something out of the database and shows it on the page ==> this works).
When I manually enter the url for one of the entities (Client), this is what I get:
<?xml version="1.0" encoding="iso-8859-1" standalone="yes"?>
<error xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
<code></code>
<message xml:lang="nl-BE">Resource not found for the segment 'Client'.</message>
</error>
The .NET Framework 3.5 is installed on that server. I ran all the updates.
I've been banging my head on this one for the last couple of hours. I don't know what else I can do or test.
Any suggestions?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
解决方案是安装此更新:
显然,默认情况下,此更新不包含在 Windows 更新中。您必须手动运行它。
这是必需的,因为我更改了默认的
InitializeService
方法,因此它需要DataServiceConfiguration
而不是IDataServiceConfiguration
:如果您想启用,则需要这样做服务器端分页(
SetEntitySetPageSize
)(等等)。The solution was to install this update:
Apparently, this one isn't included into windows update by default. You have to run it manually.
This was needed because I changed the default
InitializeService
method so it takes aDataServiceConfiguration
in stead of anIDataServiceConfiguration
:This is needed if you want to enable server side paging (
SetEntitySetPageSize
) (amongst others).新尝试:
这是一个 RESX 问题
它正在尝试查找名称 Client 的 nl-BE 翻译。
New try:
It is a RESX problem
It is trying to lookup the nl-BE translation for the name Client.