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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T19:20:17+00:00 2026-05-11T19:20:17+00:00

When I create a WCF application using the built-in Visual Studio templates and try

  • 0

When I create a WCF application using the built-in Visual Studio templates and try calling it while in a loop, only 5 requests get through. The service then stops responding. The only way that I can get around this is to close the connections after each call.

I know that you are supposed to clean up after yourself, but I also know that you didn’t have to do this with web services. A lot of the people who are going to be hitting our service won’t close their connection.

Is there a way to get the same behavior with WCF?

Here is my config

<system.serviceModel>
    <services>
      <service name="WorkflowLibrary1.Workflow1" behaviorConfiguration="WorkflowLibrary1.Workflow1.Service1Behavior">
        <endpoint address="" binding="wsHttpContextBinding" contract="WcfServiceLibrary1.IService1"/>
      </service>
    </services>
    <behaviors>
      <serviceBehaviors>
        <behavior name="WorkflowLibrary1.Workflow1.Service1Behavior">
          <serviceMetadata httpGetEnabled="true"/>
          <serviceDebug includeExceptionDetailInFaults="true"/>
      </serviceBehaviors>
    </behaviors>
  </system.serviceModel>
  • 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-11T19:20:18+00:00Added an answer on May 11, 2026 at 7:20 pm

    The 5 connections probably comes from the server – you can define the number of maximum open sessions, max concurrent calls, and max server instances by means of the servers serviceThrottling behavior.

    At the same time, will this will allow you to increase the number of concurrently open sessions, I would still recommend to properly clean up after yourself – even if you didn’t have to in the olden days…..

    I would suggest wrapping the use of your client proxy into a using statement like so:

    using(ClientProxy proxy = new ClientProxy())
    {
       // go ahead, call your service methods
    }
    

    Update: as a commentor has rightfully pointed out, this has it’s share of problems, since the client might throw an exception upon being disposed. So this might not really work all that well – or you need to wrap a try...catch around it to handle those cases where the closing of the client proxy causes an issue.

    See Avoiding Problems with the Using Statement


    That way, the client proxy is automatically closed and disposed of when the scope of the using block ends, and your channel from the client to the server is released and the server is ready to receive another call from another client.

    Also with the wsHttpContextBinding you should check whether you really need the sessions that are on by default – the recommended best practice would be to use per-call instancing on the server, e.g. each caller instantiates a new server object. Sessions introduce a whole slew of new problems and potential pitfalls, so I would try to only use them when I really really have to (and get a benefit from it) – otherwise turn off sessions.

    Marc

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

Sidebar

Ask A Question

Stats

  • Questions 203k
  • Answers 203k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Typically you would use a session per call with wcf.… May 12, 2026 at 8:39 pm
  • Editorial Team
    Editorial Team added an answer select round(FineAmount*2,-1)/2 from tickets or to put nicholaides suggestion in… May 12, 2026 at 8:39 pm
  • Editorial Team
    Editorial Team added an answer It's not perfect, but adding the last shopping cart item… May 12, 2026 at 8:39 pm

Related Questions

I'm currently designing an application which I will ultimately want to move to Windows
I have an application that is a not so simple Windows service (C#). I
I am implementing a WCF service (Contract A) that will eventually make calls to
I'm working on a project where I need the following. WCF service on the

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.