Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are WCF Proxies and what are they good for?

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.

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.

like image 573
TheJediCowboy Avatar asked Jun 08 '11 22:06

TheJediCowboy


People also ask

What is WCF proxy?

A WCF proxy is a CLR class that exposes the service contract. A Service proxy class has the service contract operations and some additional operations for managing the proxy life cycle and the connection to the service.

What is a proxy service C#?

Proxy is a structural design pattern that provides an object that acts as a substitute for a real service object used by a client. A proxy receives client requests, does some work (access control, caching, etc.) and then passes the request to a service object.

What is required by the client to generate proxy?

A metadata exchange endpoint is required to support the dynamic generation of proxy and configuration for client applications. You must explicitly enable metadata exchange by adding the endpoint and enabling the metadata exchange behavior.


1 Answers

A WCF proxy is really just a level of abstraction. You code against the proxy (ultimately an interface which is a service contract) without needing to work with the fine grain detail of dealing with the WCF communication logic. The benefit of WCF is that you can use many types of communication with the service (http, wshttp, msmq, named pipes etc) with the same proxy.

like image 182
Rory Primrose Avatar answered Oct 26 '22 06:10

Rory Primrose