我有一个非常奇怪的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
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
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扩展似乎有问题
发布评论