randy_belcher Posted February 4, 2004 Posted February 4, 2004 do you have to reload or refresh a page when you call a web service? or can you make the page look like nothing is happening eventhough you are executing a web service function? Quote
*Experts* Bucky Posted February 4, 2004 *Experts* Posted February 4, 2004 Becase ASP.NET requires the postback of the page to the server to execute code and change the contents of a page, yes, you would have to refresh the page to requery the web service. To "gracefully" refresh you might put an Update button on the page, or set a meta refresh to a certain time. Quote "Being grown up isn't half as fun as growing up These are the best days of our lives" -The Ataris, In This Diary
randy_belcher Posted February 4, 2004 Author Posted February 4, 2004 can i make the page finish loading without waiting on the web service function to complete? Quote
*Experts* Bucky Posted February 4, 2004 *Experts* Posted February 4, 2004 I suppose if you put the request to the service on its own thread, then yes, you could show the page and have the service return its results afterward. For this, I'd suggest reading up on [mshelp=ms-help://MS.MSDNQTR.2003FEB.1033/cpguide/html/cpconmanagedthreadingbasics.ht]threading[/mshelp]. Quote "Being grown up isn't half as fun as growing up These are the best days of our lives" -The Ataris, In This Diary
randy_belcher Posted February 4, 2004 Author Posted February 4, 2004 thanks, i appreciate it. i actually tried to some threading in the web service, but it didn't work. but maybe i can get it to work on the client side. for this piece of it, i really don't need a result set, because the information will be cached. basically i have an intense query that takes 20 or 30 seconds to run and I don't want the user to wait on the information. the user's page is refreshed every 30 seconds, it can load based on the cached information. after the memory is updated, the page will be upto date after it is refreshed again. Quote
samsmithnz Posted February 4, 2004 Posted February 4, 2004 Actually you can call a web service from the client side. I recently learnt how to do this. I'm planning to write an article soon (I just need permission from my boss to post some code we wrote), so that everyone can use it. It's really good looking stuff. Quote Thanks Sam http://www.samsmith.co.nz
*Experts* Bucky Posted February 4, 2004 *Experts* Posted February 4, 2004 Yes, you'll want to put the thread on the client side of the request, so that the method that calls the service can run on a different thread. If you put it in the service, the client would still be waiting for a response, no matter what thread it's running on in the service. Quote "Being grown up isn't half as fun as growing up These are the best days of our lives" -The Ataris, In This Diary
randy_belcher Posted February 5, 2004 Author Posted February 5, 2004 thanks for the input guys, i will let you know how it goes. i am also going to try to create a web service that only has a sub and not a function. i am hoping the client will not wait on a sub to run since it doesn't return anything. i will let u know how the test goes. thanks again. Quote
randy_belcher Posted February 6, 2004 Author Posted February 6, 2004 well, i don't know exactly what the best solution was, but i do have my project up and running. the main problem i had was dealing with the cache. the main reason i was having a problem was because i put a duration on my cache and i didn't remove it before updating it. another thing that helped was putting an index on the sql statement. the speed increased from 2 minutes to 5 seconds. i created an asynchronous web method, but I can't tell how much it helped out. i also created a thread on the client side web page, but it didn't seem to help the page load any faster. anyway, i appreciate the help. thanks for the input and advise. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.