tags:

views:

47

answers:

1

We have a simple ASP.Net WCF Ajax enabled webservice which is called via the generated Javascript proxy. The service does a Database Stored Procedure call to return an integer count of records. When the call is invoked from the client (IE8 on Windows 7) and the DB call takes while, I cannot call any other Javascript functions. For example one of the dropdown has a onchange event which does not fire until after the web service call completes

Have I mis-configured my WCF service and inadvertently, made it a synchronous call? or is my assumption that WCF Ajax calls are ansync wrong?

Sample Code

var count = MyNameSpace.MyService.GetCount(param1, onComplete); 

function onComplete(result){
    $get('countLabel').text = result;
}

MyNameSpace.MyService is the automagically generated proxy

Please advise

TIA rams

+2  A: 

The answer is no, they are not. The call should go out async and you should receive notification of completion or failure through the callbacks. So something seems severely wrong if you're having this problem.

The only thing to note is that older browsers do have a two connection limit when communicating with a single domain, so if you make multiple simultaneous calls, the third+ calls will not be issued until one of the previous two finishes. These connections are shared with other resources the browser might be retrieving such as images and stylesheets. In IE8+, Chrome and Mozilla the number of connections has been upped to eight I believe.

Drew Marsh
Drew, thanks for confirming my suspicions and explaining the plausible.
rams