VBAHole22 Posted February 25, 2004 Posted February 25, 2004 I'm totally confused by the whole acynch process. Here is what I have and where I want to be. ............... Code runs for a while in ASP.NET .... Web service 1 is called .... Web service 2 is called .... Results of both calls are used to log something to a table Where I want to be is this: I want web service 1 to be started and then web service 2 to be started. Then i want to wait around for both of them to finish and then go to the results part. I don't understand how I wait around for the results before continuing? Any suggestions? Quote Wanna-Be C# Superstar
*Experts* Bucky Posted February 25, 2004 *Experts* Posted February 25, 2004 The call to the webservices should stop the code in the ASP.NET application until a result is returned; I don't understand what the problem is. 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
Administrators PlausiblyDamp Posted February 25, 2004 Administrators Posted February 25, 2004 If you add a web reference to a web service .Net should also generate an Async wrapper round the call. e.g. If the web ervice had a method Test you would also get a BeginTest / EndTest that can be used to call a web method asyncronously (sp?) If you have a particular service in mind reply and I could suggest some code. PS. Bucky - love your sig :D Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
*Experts* Bucky Posted February 25, 2004 *Experts* Posted February 25, 2004 I knew you would, PD, judging by your avatar. :) 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
VBAHole22 Posted February 26, 2004 Author Posted February 26, 2004 I call both services asynch using the Begin method but this does not halt the execution of the code. And I thought that was the purpose of doing it asynch anyhow. The code that follows the two calls performs a function that updates an Oracle table with the results of the two web service calls. Therefore, I cannot have that code execute until the services have completed. I did get a suggestion for what I would consider a work around: Call both services using the Begin method with callbacks for each. When the callbacks respond have each check the result of the other to see if it has responded yet. In this manner you can determine when the last of the two is complete. Then this would in turn call a function which contained the remainder of my code. I consider this a work around because it entails me ripping out all of the code that used to sit below the web service calls in the same Sub and moving it to a Function and passing it all of the variables that would have been local to the original Sub. There has to be a better way, I am just not seeing it. Someone enlighten me. Quote Wanna-Be C# Superstar
Administrators PlausiblyDamp Posted February 26, 2004 Administrators Posted February 26, 2004 You could call each method in turn and then wait i.e. BeginMethod1 BeginMethod2 'do stuff EndMethod1 EndMethod2 the EndXXXXX methods will block until the server returns a result. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
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.