Asynchronous Web Service Calls from Client Application
-
Hi, I have made a web service and when I build the application and add the Web Reference in my Windows Application, I am not getting the Begin and End Method for making Asynchronous Web service calls. Its urgent. Kindly help. I am using C#.
-----Have A Nice Day-----
-
Hi, I have made a web service and when I build the application and add the Web Reference in my Windows Application, I am not getting the Begin and End Method for making Asynchronous Web service calls. Its urgent. Kindly help. I am using C#.
-----Have A Nice Day-----
Did you manually create the web reference or did you use VS to generate the web reference? If you are using VS remove the reference to the web service and delete the generated cs file. Then add the reference again, there should be no probably with this since all the async behavior is controlled by .Net on the client application side. The remote server does not need to know anything about the async behavior of the client. If however you have created the class yourself you will need to manually add the async calls. Here are some useful links: http://msdn2.microsoft.com/en-us/library/d9w023sx(VS.71).aspx http://www.c-sharpcorner.com/UploadFile/ssrivastav/UsingAsynchronousWebServices11232005071049AM/UsingAsynchronousWebServices.aspx
-
Hi, I have made a web service and when I build the application and add the Web Reference in my Windows Application, I am not getting the Begin and End Method for making Asynchronous Web service calls. Its urgent. Kindly help. I am using C#.
-----Have A Nice Day-----
Please don't repost problems so quickly. It's unfair on others who have also posted questions. People answer questions here of their own free will, so you have to wait until they can get round to it. If it's really, really urgent, then you will have to post it on a site where people get paid to solve problems.
Deja View - the feeling that you've seen this post before.
-
Did you manually create the web reference or did you use VS to generate the web reference? If you are using VS remove the reference to the web service and delete the generated cs file. Then add the reference again, there should be no probably with this since all the async behavior is controlled by .Net on the client application side. The remote server does not need to know anything about the async behavior of the client. If however you have created the class yourself you will need to manually add the async calls. Here are some useful links: http://msdn2.microsoft.com/en-us/library/d9w023sx(VS.71).aspx http://www.c-sharpcorner.com/UploadFile/ssrivastav/UsingAsynchronousWebServices11232005071049AM/UsingAsynchronousWebServices.aspx
Hi, I have done exactly according to the link provided by you. I created a webservice and added the reference in my windows application. I then created an object of the web service class and tried to call the Begin method, but the begin method does show up. I am not able to call the Begin method of my web method. Regards, Neeraj
-----Have A Nice Day-----
-
Please don't repost problems so quickly. It's unfair on others who have also posted questions. People answer questions here of their own free will, so you have to wait until they can get round to it. If it's really, really urgent, then you will have to post it on a site where people get paid to solve problems.
Deja View - the feeling that you've seen this post before.
-
I am so sorry, but I thought my previous question did not explain my problem well. I will keep this in mind for the next time.
-----Have A Nice Day-----
assiduous wrote:
I thought my previous question did not explain my problem well
Fair enough, but you should have modified that post instead.
Deja View - the feeling that you've seen this post before.
-
assiduous wrote:
I thought my previous question did not explain my problem well
Fair enough, but you should have modified that post instead.
Deja View - the feeling that you've seen this post before.
-
Hi, I have done exactly according to the link provided by you. I created a webservice and added the reference in my windows application. I then created an object of the web service class and tried to call the Begin method, but the begin method does show up. I am not able to call the Begin method of my web method. Regards, Neeraj
-----Have A Nice Day-----
Sorry my information is a little out of date. Things have changed it seems from 1.1 to 2. Anyway I created a quick test service and console app. You need to assign an event handler to the completed event for the method invoked. Then invoke the method using the async method call. The result of the method call is contained in the event args passed into the event handler. You have to think about the race condition between the main thread and the async thread when using this method of invoking the async call. Here is my code: static void Main(string[] args) { TestConsoleApp.localhost.Test Test = new TestConsoleApp.localhost.Test(); Test.HelloWorldCompleted += new TestConsoleApp.localhost.HelloWorldCompletedEventHandler(Test_HelloWorldCompleted); Test.HelloWorldAsync(); Console.ReadLine(); } static void Test_HelloWorldCompleted(object sender, TestConsoleApp.localhost.HelloWorldCompletedEventArgs e) { Console.Write(e.Result.ToString()); } Hope this makes sense
-
Sorry my information is a little out of date. Things have changed it seems from 1.1 to 2. Anyway I created a quick test service and console app. You need to assign an event handler to the completed event for the method invoked. Then invoke the method using the async method call. The result of the method call is contained in the event args passed into the event handler. You have to think about the race condition between the main thread and the async thread when using this method of invoking the async call. Here is my code: static void Main(string[] args) { TestConsoleApp.localhost.Test Test = new TestConsoleApp.localhost.Test(); Test.HelloWorldCompleted += new TestConsoleApp.localhost.HelloWorldCompletedEventHandler(Test_HelloWorldCompleted); Test.HelloWorldAsync(); Console.ReadLine(); } static void Test_HelloWorldCompleted(object sender, TestConsoleApp.localhost.HelloWorldCompletedEventArgs e) { Console.Write(e.Result.ToString()); } Hope this makes sense
-
Don't sweat it. We all make mistakes - me especially.;)
Deja View - the feeling that you've seen this post before.
-
So it means there is no concept of Begin and End Methods in 2.0
-----Have A Nice Day-----
By the looks of it no, you will need to create a way of checking that all the async request have completed. For more info on async see: http://www.developer.com/net/net/article.php/11087\_3481691\_1 and for creating async ASP.NET pages that consume web services see: http://msdn.microsoft.com/msdnmag/issues/05/10/WickedCode/
-
Sorry my information is a little out of date. Things have changed it seems from 1.1 to 2. Anyway I created a quick test service and console app. You need to assign an event handler to the completed event for the method invoked. Then invoke the method using the async method call. The result of the method call is contained in the event args passed into the event handler. You have to think about the race condition between the main thread and the async thread when using this method of invoking the async call. Here is my code: static void Main(string[] args) { TestConsoleApp.localhost.Test Test = new TestConsoleApp.localhost.Test(); Test.HelloWorldCompleted += new TestConsoleApp.localhost.HelloWorldCompletedEventHandler(Test_HelloWorldCompleted); Test.HelloWorldAsync(); Console.ReadLine(); } static void Test_HelloWorldCompleted(object sender, TestConsoleApp.localhost.HelloWorldCompletedEventArgs e) { Console.Write(e.Result.ToString()); } Hope this makes sense