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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T05:50:45+00:00 2026-05-12T05:50:45+00:00

I’ve created a Windows Communication Foundation service (the appDomain in this case is a

  • 0

I’ve created a Windows Communication Foundation service (the appDomain in this case is a Windows Forms application) that initializes its serviceType class as a singleton:

Starting the service works. Making a call from a client works. But if the service makes a call to itself with the above code (“//Make the 1st call to the service?”), i get a System.TimeoutException.

private static myDataService.DataProvider.CustomSingletonClass obs;

public DataProviderServiceType()
{

    //Create the object if needed.  This should only be required first time.
    if (obs == null)
    {
        obs = new myDataService.DataProvider.CustomSingletonClass();
        //Instruct the class to read its configuration and initialize.                       

        obs.initializeSingletonClass(null);

    }

}

The singleton class has a timer object that will start upon its initialization. Thus once a client makes a call is made to the service, the class is instantiated, the timer is started and the object will continue its existence with it’s timer object periodically firing.

For context, the timer’s event will update the singleton’s properties. The aim is for the singleton class to periodically perform calculations, hold the data in its properties and return whatever’s in the properties to calling client.
This way, calls to perform periodic (time-based) calculations are limited and all the clients receive the same updated data.

The problem is that once the service is hosted, it requires just one client to make a call for the singleton instance to be created and the timer started.

SetListText("Starting Service...");
host_DataService = new ServiceHost(serviceType_Data);
host_DataService.Open();
SetListText("Service is now available.");

I would like the service to initialize the singleton class with one call so that the 1st client to make a request doesn’t have to wait for the configuration and initialization to take place; the data to be refreshed upon the program’s startup.
Right after “SetListText(“Service is now available.”);” i have the following:

//Make the 1st call to the service?
EndpointAddress endpointAddress = new     EndpointAddress("http://localhost:8000/myDataService/DataProvider/TimedCalculator");
BasicHttpBinding serviceBinding = new BasicHttpBinding();

serviceBinding.CloseTimeout = new TimeSpan(0, 1, 0);
serviceBinding.OpenTimeout = new TimeSpan(0, 1, 0);
serviceBinding.ReceiveTimeout = new TimeSpan(0, 10, 0);
serviceBinding.SendTimeout = new TimeSpan(0, 1, 0);

DataProviderClient client = new DataProviderClient (serviceBinding, endpointAddress);
String[][] ArrStr = client.retrieveList();

Is there a way to have a WCF service make a call to itself in the same appDomain or is this reasonably undesirable?
Are there reasons to abandon this self-calling code and just live with the 1st client’s service call?

  • 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-12T05:50:45+00:00Added an answer on May 12, 2026 at 5:50 am

    I would do this a little different. Try this:

    • Drop using a singleton WCF service
    • Use Enterprise Library for caching
    • In your WCF service check if the data in the cache is new enough, if so return it, if not get / recalculate the data.
    • Create a windows service that polls the WCF service at spesific time intervals.

    If the time intervals are short enough it should be usual that the windows service is doing the job of regenerating.

    There are also variations of this pattern:

    • The windows service call a re-cache data service
    • Instead of a windows service you use a caching proxy product
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
For some reason, after submitting a string like this Jack’s Spindle from a text
this is what i have right now Drawing an RSS feed into the php,
I've got a string that has curly quotes in it. I'd like to replace
I have a French site that I want to parse, but am running into
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
I have some data like this: 1 2 3 4 5 9 2 6
Does anyone know how can I replace this 2 symbol below from the string

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.