Excel 插件上的 WCF
我有一个有点奇怪的要求,需要探索可能性。这是要求:
服务器端(超出我们的控制范围,无法进行任何更改)
- 我们有一个应用程序服务器在一台机器上运行。
- 应用程序服务器应该定期从Web服务读取数据(以存储 进入数据库进行进一步处理)。
客户端:
- 用户在 Excel 工作簿上工作。为了将数据同步到应用程序服务器,Excel Addin 应该能够提供 Web 服务接口。应用程序服务器将定期轮询该客户端 Web 服务以获取更新的数据。
我完全意识到这似乎是一个错误的设计,应用程序服务器应该托管一个用于读取数据的 Web 服务。但是,这就是情况所要求的。
我的问题:
1) Excel Addin 是否有可能托管 Web 服务?
2) 基于 .Net 的插件可以使用 WCF 托管 Web 服务吗?
3)如果是,WCF能否提供与ASP.Net Web服务完全相同的Web服务接口? (我读到了 BasicHTTPBinding、WSHTTPBinding 等,但找不到足够的信息来做出决定)。
4) 您能想到的任何其他替代方案吗?
谢谢,
瓦米普
I've got a somewhat weird requirement and need to explore possibilities. Here's the requirement:
Server side(out of our control and scope to make any changes)
- We have an Application server running on one machine.
- The application server is supposed to read data from Web Services at regular intervals( to store
into database for further processing).
Client side:
- The users work on an Excel Work book. To synchronize their data to Application Server, the Excel Addin should be able to provide a web service interface. The Application Server will periodically poll this client side web service to obtain Updated data.
I am completely aware that it seems to be a wrong design and that the Application server should host a web service for reading data. But, this is what the situation demands.
My question:
1) Is there any remotest possibility that Excel Addin can host a web service?
2) Can a .Net based Addin host the web service using WCF?
3) If yes, can WCF provide exactly same web service interface as ASP.Net Web services? ( I read about BasicHTTPBinding, WSHTTPBinding, etc but could not find enough information to make a decision).
4) Any other alternatives that you can think of??
Thanks,
Vamyip
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是一个多么好的架构啊...
这并不是您问题的完整答案,因为我对 Excel 编程以及实现此操作可能出现的问题几乎一无所知,但理论上应该可以在 Excel 的 .NET 插件中托管服务。我只想指出 WCF 需要什么:
BasicHttpBinding
提供服务,但如果您没有预期接口的 WSDL + XSD,那么为现有客户端创建兼容服务将是一项复杂的任务。为什么架构不能通过在应用程序服务器上公开单个服务并将数据从客户端推送到这些服务来正确完成?该应用程序的架构师应该因完全无能而被立即解雇。
What an architecture ...
This is not a full answer to your question because I know almost nothing about Excel programming and possible issues with implementing this but it should be theoretically possible to host service in .NET plugin for Excel. I will just point what is needed for WCF:
BasicHttpBinding
but if you don't have WSDL + XSDs of expected interface it will be complex task to create compatible service for existing client.Why the hell is not the architecture done correctly by exposing single service on the application server and pushing data from clients to these service? An architect of this application should be fired immediately for total incompetence.