过滤 ASP.NET Web 服务中的数据
我已经使用这个网站有一段时间了,通常能够通过浏览问题和以下标签来解决我的问题。然而,我最近遇到了一个在众多问题中很难查找的问题 - 我希望你们中的一些人能够分享您的意见。
由于我的问题有点难以用一行来表达,因此我将尝试在标题中提供有关我遇到的问题的更多详细信息。因此,正如标题所示,我需要过滤或限制我的标准 ASP.NET 基于 Soap 的 Web 服务在调用各种 Web 方法时返回的一些响应数据。 Web 服务用于返回其他系统(或多或少的数据存储库)使用的数据,现在客户端能够指定一些关于如何过滤数据的参数,并返回完整的数据集。
好吧,我想很简单,只需在需要应用更多过滤的现有 Web 方法上添加额外的过滤选项,在服务器端进行调整,我们就可以开始了 - 好吧,不幸的是结果有点比这个更棘手。
我面临的问题是,我正在开发一个在生产环境中运行的 Web 服务,该服务需要进行扩展,以便可以将附加过滤器应用于正在调用的现有 Web 方法,而不会影响已经进行的调用客户使用其客户端存根使用的其他系统。这就是我有点困扰的地方,因为我似乎无法找到扩展当前网络服务的“正确解决方案”。
今天,过滤器作为自定义数据结构发送,其中包含应过滤哪些数据的信息,但我不确定是否可以简单地向此数据结构添加更多信息,而无需在客户端破坏代码?我的一位同事建议我可以实现一个解决方案,在服务器端扩展 web.config 以保存一个部分,其中包含应排除(过滤掉)的数据的详细信息,但我没有找到这个成为一个有远见的可行解决方案 - 我不相信客户有这样的选择,因为这可能会在某些时候出错。因此,我正在寻找的解决方案是一种可以对我从客户端请求的数据应用“第二个过滤器”的方法,因此它不应返回完整的数据集,而应该只给出一小部分,它以这样的方式实现过滤器可以很容易地修改,并且不能影响当前的客户端调用。
关于我应该如何解决这个问题有什么建议吗?
谢谢! 亲切的问候, E.
I've been using this site for quite a while, usually being able to sort out my questions by browsing through the questions and following tags. However, I've recently come across a question that is rather hard to lookup amongst the great number of questions asked - a question I hope some of you might be able to share your opinion on.
As my problem is a bit hard to fit into a single line, going in the title, I'll try to give a bit more details on the problem I've encountered. So, as the title says I need to filter, or limit, some of the response data my standard ASP.NET Soap-based Web service returns on invoking various web methods. The web service is used to return data used by other systems (a data repository more or less), where the client today is able to specify a few parameters on how the data should be filtered and in return a full-set of data back.
Well, easy enough I thought, just put additional filtering options on the existing web methods which needs a bit more filtered applied, make adjustments on the server-side and we are all set to go - well, unfortunately it turned out to be a bit more tricky then this.
The problem I am facing is that I'm working on a web service running in a production environment, which needs to be extended in such that additional filters can be applied to existing web method being invoked w/o affecting the calls already being made by other systems used by the customer using their client stubs. This is where I am a bit troubled, since I can't seem to find a "right solution" on extending the current web service.
Today, the filter is send as a custom data structure which holds information on which data should filtered, but I am not sure if I can simply just add more information to this data structure w/o breaking code at the clients? One of my co-workers suggested that I could implement a solution where I would extend the web.config on the server-side to hold a section with details on which data should be excluded (filtered out), but I don't find this to be a viable solution long-sighted - and I don't trust customers with such an option since this is likely to go wrong at some point. So the solution I am looking for is a way that I can apply a "second filter" to the data I am requesting from the client so instead of getting a full-set of data back it should only give a fraction, it implemented in such that the filter can be easily modified and it must not affect the current client calls.
Any suggestions on how I should approach this problem?
Thanks!
Kind regards,
E.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
一种非常常见的做法是创建应用程序的另一个实例或使用 URL 的一部分来表示它们所连接的端点的版本,也许虚拟目录是日期。这样,旧的调用将转到旧的 API,新的调用将进入新的 API。
与
A pretty common practice is to create another instance of the application OR use part of the url to signify the version of the endpoint they are connecting to, perhaps the virtual directory is the date. That way old calls will go to the old API and new calls will come in on the new API.
vs