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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T04:51:23+00:00 2026-05-19T04:51:23+00:00

In a typical client-service application, where service is WCF, how to you use the

  • 0

In a typical client-service application, where service is WCF, how to you use the service reference?

For example, do you instantiate service for each call separately, or do you open one and keep it through the lifetime of the client app? (when I’m refering to ‘instatiating service’, I mean instantiate service object created by svcutil)

For now we used one service instance on client, because that seemed faster than always creating, opening and closing the service for each and every call, but now I wander if that was OK? The main problem we have with this approach is that timeouts occur (or we have to have sessions opened for 10hrs), connection breaks etc, and we always have to do ‘IsAlive’ through the channel to make sure everything is fine…

If it’s of any relevance the app is single threaded, and the authentication is custom built (by inserting auth tokens into header). The binding is basicHttp (or ws, doesn’t really matter for this case).

  • 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-19T04:51:23+00:00Added an answer on May 19, 2026 at 4:51 am

    Personally i prefer to keep the channel open just until the method call returns and then close it to free resources. It is the cleanest approach of all. Initializing the proxy instance each time is matter of milliseconds and never affected my performance goals.

    Having some kind of ServiceClient singleton is an interesting idea, but as you stated, it comes with a lot of side effects, so i am not sure that’s a smart approach, but since your app is single threaded, then it should not be a big issue and you will probably have some slight performance benefits.

    If saving milliseconds is mission-critical, then you could also have a pool of ServiceClients that you could get instances from.

    However, the first approach is the cleanest. Complexity is bad.

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

Sidebar

Related Questions

I have a typical Silverlight application with a WCF service and I am using
We have a typical multi-tier/layer architecture. Application + WCF Service + Repository/EF4/Database. We are
I use ActiveMQ extensively throughout our application. It's a typical client/server application where the
I have created objects that are interfaces to a web service. One typical object
I’m writing a server/client game, a typical scenario looks like this: one client (clientA)
The architecture of one of our products is a typical 3-tier solution: C# client
I am calling a non-WCF service from a WCF client. The WCF client includes
We have a typical business application with an Outlook-looking Winforms client talking to asmx
What my App does ? The App I am developing is a typical client
Typical jQuery over-use: $('button').click(function() { alert('Button clicked: ' + $(this).attr('id')); }); Which can be

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.