Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
The art of fine tuning
Message
 
To
23/10/2003 17:43:13
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
00841866
Message ID:
00841881
Views:
25
>Ok, here is a nice title. :) As usual, I'm looking for the best way to fine tune my application.
>
>The situation is that I have several ASPX files that need to gain access to specific methods from the Universal Thread Web Service. So, in the Page_Load() event, we have the Web Service instantiation, the definition of the username and password and the Login() call. That is the same for all the pages. Wouldn't there be a way to simply that by only putting this code in one place?
>
>I don't see it or not sure if that can be put in a class as I have to instantiate the Web Service. Or, is it that this shouldn't bother?

--
This is a tough question because there are a lot of different possibilities. There are always Session State to store objects, so when user came to the first page you could store the instantiate of the webservice in there, and call it from page to page. I'm not sure if the is possible in this case.

Again, it runs into the problem of a web page calling a webservice, which I still don't think is good practice. What I would do is move the logic from your webservice into its own class library, that connects to the database etc, and have both the webservice and the webpage call the same class library. It cuts down on the amount of your source code, by re-using components across webpage, webservice, and if you ever wanted to write a windows client, it could use the same components. It would improve your performance of your web pages significantly. It becomes very easy with webservices to create denial of service attacks for yourself, so that is what I would recommend.

If you don't want to do that, you may be able to put an instantiate of the webservice in the Session State, but you might have to put the code in each page, because one user might start on one page, and another user might jump into another page. You can't really control flow w/ webpages very well. If it is all one aspx, then you will know where the user starts.

That is what i would recommend.

Morgan
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform