none
Can I use AppFabric's "Auto-start" feature to make an initial WCF call? RRS feed

  • Question

  • I am working on a legacy ASP.NET application where there are multiple websites, each exposing several WCF services, and those websites have tons of initialization logic embedded inside Application_Start(). When user makes a WCF call, it takes a long-time to run the Application_Start() logic. I started to look into AppFabric's auto-start feature that allows users to specify which services to start when IIS reset itself or when an application pool recycles itself. But I was soon surprised to learn that AppFabric "does not create an instance of your service class or call any methods on it". What I want is actually to call a WCF method, achieving the same effect just like when a user uses IIS Manager to browse a .svc file and launching the web service.

    Is it possible? I played with several options, but none worked for me so far:

    1. I implemented an static void AppInitialize() function inside the WCF project, trying to call Application_Start() directly. But calling Application_Start(object sender, EventArgs e) from AppInitialize() is different from calling from an HTTP client (e.g. parameters are different), leading to crashes.

    2. I tried to define a customized service factory for the selected service, but ran into the same problem: how to call Application_Start() with the correct parameters inside CreateServiceHost() function? How to avoid calling Application_Start() twice, one by AppFabric, another one by HTTP client?

    To put it simply, I would like to run certain web services once whenever IIS restarts or whenever App pool recycles. How could I achieve that without tossing away all the existing code in Application_Start() and global.asax?

    Thanks!


    lakeeast


    • Edited by lakeeast Friday, March 22, 2013 3:25 AM
    Friday, March 22, 2013 3:24 AM

Answers

  • When the web service is hosted in IIS, it is accessible and starts on its own without any functionality to be implement in Global.asax or custom methods. 

    When the application pool recycles or server restart as any other web application Web service functions without manual/auto restart.

    AppFabric provides two services 1) Monitoring services 2) Caching services.

    It is feasible to utilise AppFabric to monitor the service for troubleshooting and caching. 

    please refer http://channel9.msdn.com/shows/Endpoint/endpointtv-AppFabric-Dashboard-Overview/


    Apriori algorithm [association rule]

    Saturday, March 23, 2013 12:21 AM

All replies