Web Application, virtual directory

Discussion in 'ASP .Net Web Services' started by Fek, Apr 5, 2005.

  1. Fek

    Fek Guest

    Hi,

    here the situation:
    My purpose is to have one physical directory(PD) (c:\webapplication) and a
    lot of virtual directory(VD) pointing to

    the physical directory. Each VD must be independant of another one.
    (resources not shared, if one fails the other

    don't)

    Configuration:
    - Windows 2000 Pro
    - IIS 5
    - .NET 1.1.4322
    - <ProcessModel enable="false"> in machine.config (because i dont want to
    use aspnet_wp.exe)
    - In PD, we have "global.asax, Service1.asmx...."
    - Each VD is configured as a web application (isolation outprocess,
    uniqueName)
    - A ServerLog to write in a console some debug
    - using C# (not important)

    Code:
    - Client: (A windows application)
    * Using a proxy, generated by Visual Studio, to access the webservice

    - Service1.asmx.cs:
    * static int iVariableForDebug = 0;
    Service1()
    {
    ServerLog.write("webservice constructor");
    }

    [WebMethod]
    public String GetInfo()
    {
    Interlocked.Increment(ref iVariableForDebug);
    ServerLog.write("webservice Method");
    return ("some info: " + iVariableForDebug.toString());
    }

    - Global.asax.cs:
    * Global()
    {
    ServerLog.write("Global constructor")
    }

    protected void Application_Start(Object sender, EventArgs e);
    {
    ServerLog.write("Application started ....." );
    }

    - 2 WebApplication:
    * WB1, WB2

    Test:(All the action are made successively)

    - Client1:
    * WebserviceProxy = new WebserviceProxy();
    WebserviceProxy.Url = "http://localhost/WB1/Servce1.asmx"
    WebserviceProxy.GetInfo();
    output:
    Global constructor
    Application started
    webservice constructor
    webservice Method
    some info: 1

    * Proxy.GetInfo();
    output:
    webservice constructor
    webservice Method
    some info: 2

    - Client2:
    * WebserviceProxy = new WebserviceProxy();
    WebserviceProxy.Url = "http://localhost/WB2/Servce1.asmx"
    WebserviceProxy.GetInfo();
    output:
    Global constructor
    Application started
    webservice constructor
    webservice Method
    some info: 1

    => - WB1 and WB2 have their own static variable
    - each WB has its own Global

    - We delete, from IIS, the WebApplication WB1

    - Client1:
    * Proxy.GetInfo();
    output: Error ... Not Found etc...

    - We re-create, in IIS, the WebApplication WB1

    - Client1:
    * Proxy.GetInfo();
    output:
    webservice constructor
    webservice Method
    some info: 3

    Questions:
    1) Why, every time we call a method in webservice, the constructor is also
    called?
    2) Why, even if we delete the webapplication from IIS, the static variable
    still living?
    2.1) is there a way to force a webapplication to dispose, without affecting
    the other one? (considering my

    configuration)

    I hope you will understand the problem
    Thank you in advance for your response
    Fek, Apr 5, 2005
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Loane Sharp
    Replies:
    1
    Views:
    761
    Bernard Cheah [MVP]
    Apr 24, 2006
  2. =?Utf-8?B?SmVmZiBCZWVt?=

    physical path to virtual path under virtual directory

    =?Utf-8?B?SmVmZiBCZWVt?=, Aug 1, 2007, in forum: ASP .Net
    Replies:
    4
    Views:
    1,022
    Eliyahu Goldin
    Aug 1, 2007
  3. Replies:
    3
    Views:
    348
    Kevin Spencer
    Feb 4, 2008
  4. Ben Fidge
    Replies:
    6
    Views:
    392
    Ben Fidge
    Oct 18, 2003
  5. rockdale

    include virtual in virtual directory?

    rockdale, Sep 3, 2008, in forum: ASP General
    Replies:
    3
    Views:
    429
    rockdale
    Sep 4, 2008
Loading...

Share This Page