Page view counter
Calling Web Services Synchronously Subscribe to this thread
Last post 01-16-2009 1:50 PM by jackbond. 6 replies.
Sort Posts:
10-07-2008 11:32 PM
Calling Web Services Synchronously

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?

Microsoft MVP - Windows Live Platform
Blog: http://pietschsoft.com | Web.Maps.VE - ASP.NET AJAX Virtual Earth Control

crpietschmann

Loading...
Joined on 07-05-2002
Wisconsin, USA
Posts 57
10-07-2008 11:52 PM
Marked as Answer
Re: Calling Web Services Synchronously

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..

Mark as answer if this post answered your question.

Harsh Bardhan

HarshBardhan

Loading...
Joined on 05-07-2008
Bangalore
Posts 1,713
10-08-2008 1:40 AM
Marked as Answer
Re: Calling Web Services Synchronously

Sorry, Chris, this topic has been done to death several times now and its almost guaranteed to be flamebait. Search for (for example):

  • Petition for return of synchronous web services (this one turned into a flame war and looks like it may have been deleted).
  • Design (As in Architecture) Strategies for dealing with async web services
  • Working with Async web services and WebRequest/WebClient (DISCUSSION THREAD)
  • Lack of synchronous server requests

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.

 

 

Kevmeister

Loading...
Joined on 04-30-2008
Posts 117
10-08-2008 10:12 AM
Re: Calling Web Services Synchronously

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.

[C# MVP]
Unblog|WebSite|IttyUrl

pbromberg

Loading...
Joined on 06-25-2002
Orlando FL
Posts 282
10-09-2008 12:48 AM
Re: Calling Web Services Synchronously

pbromberg:
... implement the NPAPI plugin model...

In case you go searching for this, the correct acronym is in fact NBAPI, for Netscape Browser API.

Kevmeister

Loading...
Joined on 04-30-2008
Posts 117
01-16-2009 11:04 AM
Re: Re: Calling Web Services Synchronously

 NPAPI is correct.  Netscape Plugin API.

http://en.wikipedia.org/wiki/NPAPI

ccoombs

Loading...
Joined on 02-08-2008
Posts 591
01-16-2009 1:50 PM
Re: Calling Web Services Synchronously

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

Jack Bond

Khet - The first Silverlight multiplayer game

Zork I: The Great Underground Empire

jackbond

Loading...
Joined on 03-21-2007
Posts 614
Microsoft Communities