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 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

Related Questions

I have client application that uses WCF service to insert some data to backend
I have a client that want to have us develop an app that will
I have a huge Web App that's switching from a HTML-rendered-on-the-server-and-pushed-to-the-client approach to a
I have the following Java socket client app, that sends same string to socket
I have a simple client server apps that uses WCF (netTcpBinding) when i'm launching
I have a small command line app that uses the Oracle client (specifically, Oracle.DataAccess).
I have a new web app that is packaged as a WAR as part
I have a game application that I will be running in a web browser
I have client with an app in the app store that was at version
I've got a small client/server test application where I have a Flex app that

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.