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 704261
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T03:55:21+00:00 2026-05-14T03:55:21+00:00

Just wondering under what circumstances would you prefer to generate a proxy from a

  • 0

Just wondering under what circumstances would you prefer to generate a proxy from a WCF service when you can just invoke calls using the ChannelFactory?

This way you won’t have to generate a proxy and worry about regenerating a proxy when the server is updated?

Thanks

  • 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-14T03:55:21+00:00Added an answer on May 14, 2026 at 3:55 am

    There are 3 basic ways to create a WCF client:

    1. Let Visual Studio generate your proxy. This auto generates code that connects to the service by reading the WSDL. If the service changes for any reason you have to regenerate it. The big advantage of this is that it is easy to set up – VS has a wizard and it’s all automatic. The disadvantage is that you’re relying on VS to do all the hard work for you, and so you lose control.

    2. Use ChannelFactory with a known interface. This relies on you having local interfaces that describe the service (the service contract). The big advantage is that can manage change much more easily – you still have to recompile and fix changes, but now you’re not regenerating code, you’re referencing the new interfaces. Commonly this is used when you control both server and client as both can be much more easily mocked for unit testing. However the interfaces can be written for any service, even REST ones – take a look at this Twitter API.

    3. Write your own proxy – this is fairly easy to do, especially for REST services, using the HttpClient or WebClient. This gives you the most fine grain control, but at the cost of lots of service API being in strings. For instance: var content = new HttpClient().Get("http://yoursite.com/resource/id").Content; – if the details of the API change you won’t encounter an error until runtime.

    Personally I’ve never liked option 1 – relying on the auto generated code is messy and loses too much control. Plus it often creates serialisation issues – I end up with two identical classes (one in the server code, one auto generated) which can be tided up but is a pain.

    Option 2 should be perfect, but Channels are a little too limiting – for instance they completely lose the content of HTTP errors. That said having interfaces that describe the service is much easier to code with and maintain.

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

Sidebar

Related Questions

A beginner question, bear with me: I'm just wondering under what circumstances one should
Just wondering if a .NET app can be compiled down to native machine code
Just wondering what the difference between BeginInvoke() and Invoke() are? Mainly what each one
I can open my file using an asset manager, it is located under assets,
I'm just wondering if its possible to have a Vaadin project working under google
I am just wondering which of these would be better to use in a
I was just wondering if this is possible using TortoiseSVN: I have a file
I was wondering when the destructor is called under these circumstances, and if it
Just wondering if anyone has had any trouble using a BackgroundWorker Thread in a
I am just wondering how would you add an optional grammer in the rule

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.