通过 WCF 服务层传递计算数据以进行报告
我不太确定如何最好地表达这一点。我们有一个 ASP.NET Web 应用程序,其后端服务可通过 WCF 服务层访问。我们需要向 Web 应用程序添加一些报告/仪表板类型位。
为了使其可扩展,需要在后端计算报告所需的数据。我只是想知道是否有推荐的方法来传递这些数据。使用不同的服务方法来获取不同的数据位并没有多大意义,感觉应该已经总结好了。
我查看了 WCF 数据服务,但这似乎更适合检索完整的对象树。也许某种 XML 文档可以将额外的项目添加到摘要中,而不需要更改服务层?
数据可能是今天的订单数量、特定于运行它的人的订单数量、未完成的未结订单等。
有人有任何指示吗?
感谢您抽出时间
I'm not really sure how to best word this. We have an ASP.NET web application with the backend services accessible over a WCF service layer. We need to add some reporting/dashboard type bits to the web application.
To make it scalable the data needed for the reporting needs to be calculated on the backend. I'm just wondering if there is a recommended way to pass this data around. It doesn't make much sense to have different service methods to get the different bits of data, it feels like it should be summarised already.
I had a look at WCF Data Services, but that seems more for retrieving full object trees. Maybe some sort of XML document so extra items can be added to the summary without needing service layer changes?
The data would be things like number of orders today, number of orders specific to the person running it, open orders outstanding etc.
Does anyone have any pointers?
Thanks for your time
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以查看 ASP.NET Web API 之类的内容,并为您的数据使用 XML 格式化程序。您可以使用 ViewModel 来展平数据并通过网络发送到您的 Web 应用程序以绑定到网格或任何您需要的内容。
基本上,您将从 Web 应用程序获取请求(过滤器、关键字等),将参数发送到报告后端,检索报告数据,将值映射到 ViewModel 并使用 Web API 序列化它们。使用 Web API,您可以使用各种格式化程序将数据转换为 XML、CSV 和 JSON、vCard、iCal、PDF 等...
您可以在此处阅读有关它的更多信息:http://www.asp.net/web-api
You can look at something like ASP.NET Web API and use an XML Formatter for your data. You can use ViewModels to flatten your data and send over the wire to your web app to bind to grids or whatever you need to.
Basically you would get request (filters, keywords, etc) from your web app, send the parameters to your reporting back-end, retrieve the reporting data, map the values to your ViewModels and serialize them using Web API. Using Web API you can use all kinds of formatters for your data to XML, CSV and JSON to vCard, iCal, PDF, etc...
You can read more about it here: http://www.asp.net/web-api