Odata扩展似乎有问题 [英] Odata expand seems to have a problem

查看:83
本文介绍了Odata扩展似乎有问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个非常奇怪的odata服务问题,

I got a very strange Problem with an odata Service,

当我将以下请求发送到我的服务时,结果还可以。

When I put the following Request to my service, the result is OK

http:// localhost:53733 / WcfDataService1 .svc / artikel?$ filter = a_nr eq'0101030'& $ expand = artgruppe,artinhalt / inhaltstoff

http://localhost:53733/WcfDataService1.svc/artikel?$filter=a_nr eq '0101030' & $expand=artgruppe,artinhalt/inhaltstoff

datamodel description

datamodel description

artikel有一个artgruppe,还有几个artinhalt

artikel has one artgruppe, and several artinhalt

一个artinhalt引用一个inhaltstoff

one artinhalt references one inhaltstoff

当我以上述方式查询时,我得到了正确的结果。

when I query in the way above, I get a correct result.

当我查询

http:// localhost:53733 / WcfDataService1.svc / artikel?$ filter = a_nr eq'0101030'& $ expand = artinhalt / inhaltstoff

http://localhost:53733/WcfDataService1.svc/artikel?$filter=a_nr eq '0101030' & $expand=artinhalt/inhaltstoff

我从Odata得到一个语法错误,这不是真正的预期结果:

I get a Syntax Error From Odata which cannot be really the expected result :



< 代码
/>

推荐答案

您能否提供更多信息:

1)服务器的哪个版本的WCF DS?

2)服务器的MaxProtocolVersion是什么?



我同意查询看起来很好。 您是否尝试过其他类似的组合来查看会发生什么?例如,删除filter子句简化了事情,但不应该对问题产生影响。所以我会试试。然后,你可以尝试其他组合
的扩展,看看哪些有效,以及什么重生这个错误。



在我看来,这个错误来自于DB2通过ExpandProvider和WCF DS正好表现出错误。我假设你有一个自定义提供程序来使用DB2?你拥有这个代码吗?在我看来,错误是在自定义提供程序中。

Could you provide a little more information:
1) What version of WCF DS is the server?
2) What's the MaxProtocolVersion of the server?

I agree that the query looks fine.  Have you tried other similar combinations to see what happens? For instance, removing the filter clause simplifies things but should have no effect on the issue. So I would try that. Then, could you try other combinations of expand and see what works and what repro's this error.

It looks to me like this error is coming up from DB2 through the ExpandProvider, and WCF DS is just surfacing the error. I assume that you have a custom provider to work with DB2? Do you own this code? It seems likely to me that the bug is in the custom provider.


这篇关于Odata扩展似乎有问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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