Search code examples
.netwcfwcf-client

WCF Client: How to optimize Service calls?


I'm developing a WPF Client which interacts with a WCF Web Service which persists data on a database using NHibernate.

I understand that I can add a service reference to my Client in order to generate classes from the Web Service's metadata. These classes would then allow me to interact with my Service by simply instantiating objects and calling methods using them.

My question is:

Should I simply use these objects as-is, or are there any possible improvements by "wrapping" the service calls in a class which handles all communications with the Web Service ?

In other words, would creating a proxy in my client everytime I want to communicate with my service be costly performance-wise ? If so, would I need to create a class which "wraps" the generated classes and which holds on to a channel ?

What are some improvements that you can recommend besides simply creating a proxy and using it to interact with a Service ?

Thanks


Solution

  • Allow me to direct you toward this article which talks about the caching of channels in the client proxy.