Skip to main content
Home Forums Silverlight Programming Programming with .NET - General Calling Web Services Synchronously
6 replies. Latest Post by jackbond on January 16, 2009.
(0)
crpietsc...
Member
217 points
57 Posts
10-07-2008 11:32 PM |
It's a real bummer that you can't call web services synchronously in Silverlight. At least the functionality isn't baked in like it should be. Why limit us!
Could people post their suggestions on their best methods for accessing Web Services Synchronously in Silverlight here?
HarshBar...
Star
9908 points
1,719 Posts
10-07-2008 11:52 PM |
Hi,
You can write your logic which you want to execute after Webservice call completion in Completed event of your Web service call so that your call to service will be completed.
You can use a dispatcher timer also and after certain duration you can check a flag(which you will set in web service call completed handler) and accordint to that you can execute your code..
Kevmeister
249 points
119 Posts
10-08-2008 1:40 AM |
Sorry, Chris, this topic has been done to death several times now and its almost guaranteed to be flamebait. Search for (for example):
The main point is that it looks like synchronous behaviour was removed on account of not being supported by all browsers. I'd certainly like to see it returned, but the reality at present is that if you live with that hope, you'll get nothing done.
Instead you need to alter your implementation practices to allow for async. Depending on the job at hand there are a number of different strategies available to get the job done, but be warned that none are as simple as the synchronous option would have been, despite what some people tried to argue.
pbromberg
Participant
1984 points
353 Posts
10-08-2008 10:12 AM |
In order to be cross-browser, Silverlight needs to implement the NPAPI plugin model which only provides for asynchronous calls. It's not hard to learn to use.
10-09-2008 12:48 AM |
pbromberg:... implement the NPAPI plugin model...
In case you go searching for this, the correct acronym is in fact NBAPI, for Netscape Browser API.
ccoombs
Contributor
5018 points
743 Posts
01-16-2009 11:04 AM |
NPAPI is correct. Netscape Plugin API.
http://en.wikipedia.org/wiki/NPAPI
jackbond
2806 points
722 Posts
01-16-2009 1:50 PM |
Microsoft could use the underlying operating system's native network stack instead of the plugin APIs. Using this approach would have benefits beyond synchronous calls, one being a more robust Soap implementation. Short of that, the only currently work around is to use the native XmlHttpRequest, more details here, http://silverlight.net/forums/t/11508.aspx