使用http代理在两个WCF Windows服务之间进行通信 [英] Communication between two WCF Windows Services using http Proxy

查看:91
本文介绍了使用http代理在两个WCF Windows服务之间进行通信的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是WCF的新手,我正在开发一个项目,他们正在使用Http Proxy在两个WCF Windows服务之间进行通信。在看到实现之后,我理解的方式是在代理服务器中生成服务合同,并且发出请求的Windows服务应使用代理服务器库来访问由其他WCF服务公开的OperationContracts。如果我的理解有任何问题,请纠正我。这样做的优点和缺点是什么,并且考虑到两个Windows服务都在同一台机器上,还有没有使用Http Proxy服务器的任何替代方法吗? br />


另外,2 Web服务之间如何处理?



提前谢谢。

I am a newbie to WCF and I am working on a project where they are using Http Proxy to communicate between two WCF Windows Services. After seeing the implementation, the way I understood is that a Service Contract is generated in the Proxy Server and the Windows Service which is making a request shall use the Proxy server library to access the OperationContracts exposed by the other WCF service. Please correct me if there is anything wrong in my understanding.What are the Pros and Cons of doing this way and also is there any alternate way for achieving the same without using Http Proxy servers considering both the windows services are in the same machine?

Also, how is it handled between 2 Web Services?

Thanks in advance.

推荐答案

请参阅我对该问题的评论。我得到的印象是你混淆了两个不相关的概念。



了解代理服务器:

http://en.wikipedia.org/wiki/Proxy_server [ ^ ]。



对于WCF代理,概念来自存根的概念 分布式计算

http://en.wikipedia.org/wiki/Stub_%28distributed_computing%29 [ ^ ]。



术语令人困惑。这是历史性的事情。事实上,在某些系统的术语中,同样的事情被称为代理或服务器存根: http:// en。 wikipedia.org/wiki/Remote_procedure_call [ ^ ]。



要了解WCF代理,请参阅:

http://msdn.microsoft.com/en-us/library/ms734712%28v=vs.110%29.aspx [< a href =http://msdn.microsoft.com/en-us/library/ms734712%28v=vs.110%29.aspxtarget =_ blanktitle =New Window> ^ ] ,

http://msdn.microsoft.com/en-us/library /ms730144.aspx [ ^ ]。



请参阅此CodeProject文章: WCF代理生成选项 [ ^ ]。



-SA
Please see my comment to the question. I got an impression that you confused two unrelated concepts.

Read about the proxy servers:
http://en.wikipedia.org/wiki/Proxy_server[^].

As to the WCF proxy, the concept came from the concept of stub as it is understood in distributed computing:
http://en.wikipedia.org/wiki/Stub_%28distributed_computing%29[^].

The terminology is confusing. This is historical thing. It's just so happened that, in the terminology of some systems, the same thing is called either proxy or server stub: http://en.wikipedia.org/wiki/Remote_procedure_call[^].

For understanding of WCF proxies, please see:
http://msdn.microsoft.com/en-us/library/ms734712%28v=vs.110%29.aspx[^],
http://msdn.microsoft.com/en-us/library/ms730144.aspx[^].

Please see also this CodeProject article: WCF Proxy Generation Options[^].

—SA


这篇关于使用http代理在两个WCF Windows服务之间进行通信的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆