[英]Error (414) Request-URI Too Long when calling a wcf web service
I'm developing a wcf web service for one of our clients, and they reported an error I do not understand at all. 我正在为我们的一位客户开发wcf Web服务,他们报告了一个我根本不理解的错误。 First of all, what the wcf does: it just saves objects in a database they dont have access. 首先,wcf的作用是:它将对象仅保存在他们无权访问的数据库中。 That's all. 就这样。 I've tested the wcf saving up to 100/150 objects. 我已经测试过wcf最多可以保存100/150个对象。 But, when they call the web service, they cant even save 50 because it throws the exception "The remote server returned an error: (414) Request-URI Too Long". 但是,当他们调用Web服务时,他们甚至无法保存50,因为它抛出异常“远程服务器返回错误:(414)请求URI太长”。 I understand that each browser has a limit to the size of the url, but i really dont understand WHY, when calling the web service, they're having this problem. 我知道每种浏览器对URL的大小都有限制,但是我真的不明白为什么,当调用Web服务时,他们遇到了这个问题。
Maybe this can help, but i think they call the web service from a web api and not directly from their webpage/app. 也许这可以有所帮助,但我认为他们是通过Web API而不是直接从其网页/应用程序调用Web服务。
If anyone has an idea that could help me, I would be very grateful. 如果有人对我有帮助,我将不胜感激。
This is nothing to do with their client per se. 这与他们的客户本身无关。 The 414 error is coming from your server because the Request-URI that they are passing it is too long. 414错误来自您的服务器,因为它们传递的Request-URI太长。 This is normally caused by the client performing an HTTP GET rather than a POST. 这通常是由客户端执行HTTP GET而不是POST引起的。 Thus the querystring becomes too large when too many parameters are passed within it. 因此,当在其中传递太多参数时,查询字符串将变得太大。 Check that they are using a POST as this service clearly needs to be exposed using that verb. 检查他们是否正在使用POST,因为显然需要使用该动词来公开此服务。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.