Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Making sure Web Service is isolated
Message
De
18/04/2006 04:57:40
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
Web Services
Titre:
Making sure Web Service is isolated
Divers
Thread ID:
01114225
Message ID:
01114225
Vues:
60
Recently, there have been a few threads in regards to how the Web Service works in .NET and the issue of Shared variables. The biggest problem I had was that one Web Service was changing the values of some variables in another Web Service. This was due because I had variables defined as Shared. Basically, one Web Service was assigning Framework.App.nNoMember=1 and during its own process, if at the same time another call was done, Framework.App.nNoMember could be have been changed in the first Web Service before it had time to be completed, thus resulting in some severe reactions as the ID of the user was changed from the time the process started and the time the process ended.

I have experienced that with several other variables as well. This was all related because of the use of Shared variables.

In order to be sure that each environment is isolated, I started to adjust my framework and remove all the Shared attributes where it was causing some problems. However, that task was extremely difficult as now, many of my .vb files cannot see other classes and their variables as an instance of each class (.vb file) has to be created in order to gain access to those properties and methods. Thus, it makes it more complicated as one class cannot see what's in the other class unless an instance is created.

Before that, I already had some classes that were not Shared thus the application was created an object of the related ones, where needed, and was making a direct access to the other ones, where Shared was present. But, now, the process is much more complicated as everything has to be handled as an object and this causing me a lot of problems.

After having spent the weekend on this trying to adjust my framework, I came to the conclusion that this doesn't make any sense. I am probably not the first one in that position. Also, in all the samples I have found on the Internet, not one was making a reference to pay attention to that or be careful with the Shared approach. It seems that everyone create all their classes with Shared as we can simply gain access to a method like Framework.Web.Image() instead of having to create an object of Framework.Web and using that object to call the Image() method after.

Am I the only one who discovered that using that Shared approach will cause problems in production where one call to a Web Service is changing the environment of the other Web Service being executed. I guess the answer is probably not. So, the question is why can't I find any documentation about it. I just can't understand why this is like this and why there aren't any guidelines on how to do it.

So, I started to think that there could be a way to control that outside of the application. Is there a setting in IIS, under the ASP.NET panel which would allow us to tell the server to work in independent mode with those Web Services? There has to be a setting somewhere. Basically, I want all my Web Services to be in their own independent environment so a call to another Web Service at the same time won't affect the one being executed.

Anyone would like to share some comments on that?
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Répondre
Fil
Voir

Click here to load this message in the networking platform