Difference between proxy and channel factory in wcf
1. Difference between Proxy and Channel Factory in WCF
S.No Proxy Channel Factory
1 What is the prerequisite for
Proxy ?
Only require URL where the
service resides .
What is the prerequisite for
Channel Factory ?
We must have direct access to the
assembly that contains that service
contract T for.
2 In terms of complexity ?
Very Simpler.
In terms of complexity ?
Not easier.
3 In terms of understandability
?
Easy to Understand.
In terms of understandability ?
Channels are complex, network-
related.
4 How to use Proxy ?
There is Visual Studio gives us
add the reference.
How to use Channel Factory ?
When we share a common service
contract dll between the client and
the server, we will be using the
ChannelFactory class.
5 When we will go for Proxy ?
If we know that our entities will
change much and the client
code is more, then we need to
go for Proxy.
Proxy has following limitations,
1. Properties need to have
gets and sets
2. Constructors cannot be
exposed
3. Methods other than the
service contract cannot
be exposed
When we will go for Channel
Factory ?
If we know that our entities will not
change much and the client code is
less, then a DLL would work better
than a Proxy.
2. 6 How to create Proxy ?
By using SVCutil.exe we will
create PRoxy
How to create Channel Factory ?
When we are using DLL that refers
Service contract interface then use
the channel factory class
References:
http://www.sujitbhujbal.com/2012/03/difference-between-proxy-and-channel.html
http://www.codeproject.com/Tips/558163/Difference-between-Proxy-and-Channel-Factory-
in-WC