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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T07:49:02+00:00 2026-05-12T07:49:02+00:00

I have a client app that tries every 10 seconds to send a message

  • 0

I have a client app that tries every 10 seconds to send a message over a WCF web service. This client app will be on a computer on board a ship, which we know will have spotty internet connectivity. I would like for the app to try to send data via the service, and if it can’t, to queue up the messages until it can send them through the service.

In order to test this setup, I start the client app and the web service (both on my local machine), and everything works fine. I try to simulate the bad internet connection by killing the web service and restarting it. As soon as I kill the service, I start getting CommunicationObjectFaultedExceptions–which is expected. But after I restart the service, I continue to get those exceptions.

I’m pretty sure that there’s something I’m not understanding about the web service paradigm, but I don’t know what that is. Can anyone offer advice on whether or not this setup is feasible, and if so, how to resolve this issue (i.e. re-establish the communications channel with the web service)?

Thanks!

Klay

  • 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-12T07:49:02+00:00Added an answer on May 12, 2026 at 7:49 am

    Client service proxies cannot be reused once they have faulted. You must dispose of the old one and recreate a new one.

    You must also make sure you close the client service proxy properly. It is possible for a WCF service proxy to throw an exception on close, and if this happens the connection is not closed, so you must abort. Use the "try{Close}/catch{Abort}" pattern. Also bear in mind that the dispose method calls close (and hence can throw an exception from the dispose), so you can’t just use a using like with normal disposable classes.

    For example:

    try
    {
        if (yourServiceProxy != null)
        {
            if (yourServiceProxy.State != CommunicationState.Faulted)
            {
                yourServiceProxy.Close();
            }
            else
            {
                yourServiceProxy.Abort();
            }
        }
    }
    catch (CommunicationException)
    {
        // Communication exceptions are normal when
        // closing the connection.
        yourServiceProxy.Abort();
    }
    catch (TimeoutException)
    {
        // Timeout exceptions are normal when closing
        // the connection.
        yourServiceProxy.Abort();
    }
    catch (Exception)
    {
        // Any other exception and you should 
        // abort the connection and rethrow to 
        // allow the exception to bubble upwards.
        yourServiceProxy.Abort();
        throw;
    }
    finally
    {
        // This is just to stop you from trying to 
        // close it again (with the null check at the start).
        // This may not be necessary depending on
        // your architecture.
        yourServiceProxy = null;
    }
    

    There was a blog article about this, but it now appears to be offline. A archived version is available on the Wayback Machine.

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

Sidebar

Ask A Question

Stats

  • Questions 175k
  • Answers 175k
  • 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 Required reading is Problems with rewriting history in the Git… May 12, 2026 at 3:09 pm
  • Editorial Team
    Editorial Team added an answer How are you consuming the child process stdout and stderr… May 12, 2026 at 3:09 pm
  • Editorial Team
    Editorial Team added an answer Short answer: No. The source code compiler won't replace a… May 12, 2026 at 3:09 pm

Related Questions

I'm currently trying to build an application that inherently needs good time synchronization across
I'm just getting into creating some WCF services, but I have a requirement to
See also How does a WCF server inform a WCF client about changes? (Better
What is the best possible way to share a single instance of a WCF

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.