Page view counter
Calling Web Services Synchronously
Last post 10-09-2008 12:48 AM by Kevmeister. 4 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?

Chris Pietschmann
Microsoft MVP - Windows Live Platform
ASP.NET AJAX Virtual Earth Control

crpietschmann

Loading...
Joined on 07-05-2002
Wisconsin, USA
Posts 54
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,161
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 116
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 238
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 116
Microsoft Communities