Wednesday, January 1, 2014

Exception on WebService Method Callback


I think that the problem is that the async result object that you have was created by client.BeginGetCityWeatherByZIP, which is different from client.EndGetCityForecastByZIP.


I'm not sure exactly how you structured your program (what do the two GetCityWeatherByZip functions do?), so I can't give you instructions on how to fix it.


Basically, structure it according to the C# Async Guidelines so that you have one function for the whole task, and it should work.




Wasabi Fan



Thanks for your time !



  • Well, for the first part of your comment, it seemed confusing when I tried this :



IAsyncResult ar = client.BeginGetCityWeatherByZIP(zip, result => client.EndGetCityWeatherByZIP(result), null);


  • This is just a small test console application for a publicly & freely available web service ( as you might have already guessed )so what you're seeing above is actually the only "structure" :=)





  • and for the final and last ... I am sure you've visited the link I've posted in the reference section , which links to an MSDN example ... that is actually what I am trying to catch up.





No comments:

Post a Comment