tags:

views:

163

answers:

2

Hi All,

I am just curious to know that what is ClientBase class in WCF, and how can i use it. I surfed the internet and i found that this class is used to create proxies to call service methods , but no example. Please anyone explain it with example , it will help me undestand this class...

A: 

It's there for autogenerated proxies which are created when service references are added to your project, not really for your own use.

blowdart
can i extend it , i don't want to add service reference to create proxy.
Praveen
No. If you don't want a created proxy then you should be using ChannelFactory<T> and sharing the interface and contract objects.
blowdart
A: 

It's the base class for your client proxies being generated by either "Add Service Reference", the svcutil.exe command line utility, or by your custom code if you don't want to use any of those methods.

It's a generic type that takes the generated client-copy of the service contract as its type parameter.

It can be extended, if you wish to do so - e.g. see IDesign's download page for a few samples of what can be done, things like:

  • AsyncClientBase for safe asynchronous calls
  • HeaderClientBase for simplified support of custom headers in your messages

Marc

marc_s