Web Application, virtual directory

F

Fek

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,968
Messages
2,570,154
Members
46,702
Latest member
LukasConde

Latest Threads

Top