Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3968686
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T03:52:22+00:00 2026-05-20T03:52:22+00:00

Should one use the generated WCF service client (e.g. MyServiceClient) when invoking a WCF

  • 0

Should one use the generated WCF service client (e.g. MyServiceClient) when invoking a WCF service from silverlight, or instead use the ChannelFactory (e.g. ChannelFactory.Create())?

Other questions have asked this question: WCF/Silverlight: Why use a ChannelFactory instead of a Client?

However, the responses just say it’s best to re-use the ChannelFactory. But if this is done directly, you lose all of the other functionality of the generated WCF service client (the async events, etc.)

Is there no way to get the generated WCF service client to re-use the ChannelFactory itself?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T03:52:23+00:00Added an answer on May 20, 2026 at 3:52 am

    WCF Fiasco

    START_RANT

    Even Microsoft and WCF team know that the way ChannelFactory and Channel and ClientBase was designed and the way it was changed because of various performance issues was a real fiasco. Just the fact that the disposing of proxy is a real mess is enough to know underneath extensibility of WCF, we are dealing with an inefficent, bloated and convoluted design. Just bad bad bad.

    END_RANT

    OK, you probably have looked at documentation but I assume you have not been able to find your answers – as I did not – since there is no easy answer. But here my findings which hopefully summarises these points (you cannot find below in any MS documentation):

    1) We have ChannelFactory and IChannel. ChannelFactory knows how to communicate with the transport and channel knows how to interprete parameters to WCF method calls and Vice Versa. IChannel is the one that “implements” (or looks like implementing) your service interface while ChannelFactory has all necessary abstractions for communicating (including endpoint, security, …).

    2) ClientBase is nothing but both ChannelFactory and IChannel cobbled together. So it is obvious that creating ChannelFactory once and then creating channels over and over means it is more efficient, howevere as you guessed it is not that easy because …

    3) ChannelFactory once opened, cannot be changed. This means that if you use username password to connect to WCF service and that username password changes, then you need a new one. This might not seems like a big problem but it becomes a big problem in an ASP NET scenario.

    4) ChannelFactory and IChannel in fact reuse the same underlying communication channels so closing ChannelFactory will make IChannel invalid. This causes confusion in clean up code and decising whose responsiblity is it to close the connection.

    5) As you see there is no easy answer. If you do not have to use username/password or change configuration at runtime, create and cache ChannelFactory and then just create the channels. In any case ChannelFactory and IChannel is more efficient than ClientBase.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have WCF Class library, WCF Service Client and WCF Service Server in one
When should one use the f:viewAction or preRenderView event to initialize data for a
Possible Duplicate: When should one use final? When should Java programmers prefer to use
When exposing some code to D-Bus using Qt D-Bus bindings, when should one use
Are there any counterindications to fork under mod_perl2? Should one use another way to
What is a jagged array (in c#)? Any examples and when should one use
What tasks should one not use HBase for? My understanding is that HBase and
What fork, or combination of packages should one to use to make PyPy, Django
I've read that good programming practice claims that one should use a function if
I'm trying to understand whether and under what circs one should use Python classes

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.