带有正斜杠的键在WCF数据服务中不起作用 [英] Keys with forward slashes do not work in WCF Data Services

查看:61
本文介绍了带有正斜杠的键在WCF数据服务中不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,

我在第三方数据库之上设置了(相对)简单的Linq-to-SQL模型。 此数据库包含可以包含正斜杠的关键字段。 不幸的是,我无法更改这些关键字段,因此我的数据服务必须以某种方式访问​​它们。

我在Windows上使用Visual Studio 2010 RC(4.0.30128 RC1Rel) 7 x64。

我阅读了一下,似乎我应该能够在 web.config 中使用以下内容来使其工作:

Hello,

I have a (relatively) simple Linq-to-SQL model set up on top of a third party database.  This database has key fields that can contain forward slashes.  Unfortunately I'm not in a position to change these key fields, so my data service has to somehow give access to them.

I am using the Visual Studio 2010 RC (4.0.30128 RC1Rel) on Windows 7 x64.

I read around a bit, and it seems that I should be able to use the following in web.config to get it to work:



<
uri> <schemeSettings> <clear /> <add name="http" genericUriParserOptions="DontUnescapePathDotsAndSlashes" /> <add name="https" genericUriParserOptions="DontUnescapePathDotsAndSlashes" /> </schemeSettings> </uri> <system.net> <settings> <httpListener unescapeRequestUrl="false"/> </settings> </system.net>

推荐答案


<您似乎正在使用ASP.NET开发人员Web服务器来托管您的服务。该Web服务器具有许多已知的限制。这可能是其中之一(虽然我没试过)。您可以尝试在IIS上托管您的服务,看看它是否有效? (这通常解决了很多这类问题。)
谢谢,
Hi,

It seems you're using the ASP.NET developer web server to host your service. This web server has many known limitations. This might be one of them (I didn't try it though). Could you try hosting your service on IIS and see if it works? (That usually fixes lot of these types of issues).

Thanks,


这篇关于带有正斜杠的键在WCF数据服务中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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