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

  • SEARCH
  • Home
  • 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 3663410
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T01:31:37+00:00 2026-05-19T01:31:37+00:00

I have found 2 ways of consuming a WCF service without the help from

  • 0

I have found 2 ways of consuming a WCF service without the help from svcutil.exe:

  • ClientBase<IService>
  • ChannelFactory<IService>

I know that ClientBase probably uses ChannelFactory. But I’m talking about choosing between writing:

public sealed class ServiceClient 
    : ClientBase<IService>, IService
{
    ReturnType IService.MethodName(ParameterType parameterName)
    {
        return Channel.MethodName(parameterName);
    }
}

// later
IService client = new ServiceClient();
var result = client.MethodName(parameterName);

or

ChannelFactory<IMyService> channelFactory = new ChannelFactory<IMyService>();
channelFactory.Open();

var channel = channelFactory.CreateChannel(); 
var result = channel .MethodName(parameterName);

channelFactory.Close();

Which one should I choose?

  • 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-19T01:31:38+00:00Added an answer on May 19, 2026 at 1:31 am

    What are your criteria for choosing?

    Functionally, in the end, both approaches work just fine and basically give you the same result.

    What do you want to base your decision on?

    My advice: pick the style that you feel more comfortable with! The approach with the ChannelFactory<IService> probably requires you to write less and less mundane code – so maybe that would be a little advantage for that approach.

    Both approaches require that you have .NET on both ends of the channel, and that service and client share a common assembly with the service and operation contracts in them – since the client must know at least the service interface in order to be able to use either of the two ways of connecting to the service.

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

Sidebar

Related Questions

I have found several ways online but none seem to work. Does anyone know
I have found two ways to extract matches in Python: 1. def extract_matches(regexp, text):
i have found some ways but they are actually reading frames and applying transition
I have found Okapi Similarity measure can be used to calculated document similarity from
I have found many great answers to this from a year ago (when it
I have found two ways on keeping the screen on: First one is simpler:
I have found many ways to measure width and to truncate text using jquery,
I have found two ways to enable localization for iOS project: Creating localized .xib
I have found two ways of taking floors in Python: 3.1415 // 1 and
I have found ways on google to select rows within X amount of days,

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.