Quartz .Net Job调用WCF服务
从 Quartz .Net 作业中调用 WCF 服务的最佳方式是什么?
编写一个单独的 exe 来启动 WCF 代理并从作业中调用该 exe 是最简单的方法吗?这看起来似乎可行,但有点复杂。如果我能以某种方式让作业以某种方式注入代理,那就更好了。
谢谢, 马特
What's the best way for me to call a WCF Service from within a Quartz .Net job?
Is the easiest way to write a separate exe that spins up a WCF proxy and have that exe called from within the job? This seems like it would work but is a bit convoluted. It'd be nicer if I could somehow have the Job have the proxy injected in someway.
Thanks,
Matt
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
单独的 exe 听起来有点像让事情变得过于复杂。作业也应该能够自行调用服务,除非需要考虑一些依赖关系图。你使用一些 IoC 框架吗?
如果您从单元测试的角度来看,为代理提供令人满意的接口,然后允许通过 setter 属性将不同版本的代理(模拟)设置到作业中,这难道不就足够了吗?
A separate exe sounds a bit like over complicating things. A job should be quite able to call the service by itself also unless there's some dependency graph that needs to be accounted for. Are you using some IoC framework?
If you look things from unit testing perspective wouldn't it be just sufficient to have satisfactory interface for the proxy and and then allow setting of different version of it (mock) to the job via setter property?