什么是 WCF 代理?它们有什么用? [英] What are WCF Proxies and what are they good for?
问题描述
我最近一直在自学 WCF,我什至使用 WCF 编写了一些生产服务.但直到最近我才真正深入研究 WCF.
I have recently been educating myself about WCF and I have even written some production services using WCF. But I have never really looked too much into WCF until recently.
我知道代理"设计模式的想法.我也知道在 ASMX Web 服务中使用代理.但是我很难理解 WCF 代理是什么以及它是如何使用的.我已经彻底查看了有关 WCF 的 MSDN 文档,但我仍然没有掌握 WCF 服务使用代理的大局.
I am aware of the idea of the "proxy" design pattern. I am also aware of the use of a proxy with ASMX web services. But I am having a hard time understanding what a WCF proxy is and how it is used. I have looked thoroughly over the MSDN documentation about WCF, but I am still not grasping the big picture of the use of proxies with WCF services.
推荐答案
代理是进程外服务的进程内代表.您调用代理(这很容易),它会设置通信渠道等并与远程服务对话(这很困难).
A proxy is an in-process representative of an out-of-process service. You call the proxy (which is easy), which setups up the communication channels etc. and talks to the remote service (which is hard).
另见 http://msdn.microsoft.com/en-us/图书馆/ms730144.aspx.
这篇关于什么是 WCF 代理?它们有什么用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!