.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
MarieAdela
Imran Ghani
Post New Web Links

Asynchronous WCF call seems to be blocking

Posted By:      Posted Date: September 05, 2010    Points: 0   Category :WCF
 
Hi all,I have a Silverlight application that calls a WCF web service which is hosted in an ASP.NET web application. On the client side I call two methods A and B on the service's interface asynchronously; each time a new proxy is created and used to call the respective method. Since the service has its InstanceContextMode set to PerCall, each call should create a new service instance and be independent from the others.For testing purposes I have added a Thread.Sleep(5000) to the implementation of method A.What I expect now is that when the client calls methods A and B one after the other, the service should process both calls in parallel and since method A has the call to Sleep(), method B should return first. Five seconds after that, method A should return as well.For the very first attempt in the web application's lifetime this works as expected, i.e. after rebuilding or performing an iisreset and calling those methods from the client side, it shows the expected behavior explained above. Here's a sample debug dump I received on the client:    Method B, 17:41:23, Server-Thread-ID: 9    Method A, 17:41:28, Server-Thread-ID: 8But after that, when I call those methods again (in exactly the same way), method A seems to block on the server:    Method A, 17:42:43, Server-Thread-ID: 1    Method B, 17:42:44, Serv


View Complete Post


More Related Resource Links

Cancel asynchronous WCF call ?

  
In .NET 3.5, is it possible to cancel an asynchronous call to a WCF service ?   The desire is that a user search screen may fire a very long running SQL query in the middle tier, which they then want to cancel. The idea is that the actual database query gets cancelled, not just the WCF call to the middle-tier (otherwise the SQL query is still chewing up resources in the database). Is this possible ?   I'm using the event-based asynchronous pattern that was introduced for WCF in .NET 3.5, which Microsoft are now recommending to be used: http://msdn2.microsoft.com/en-us/library/ms734701.aspx e.g. Code Snippet ... //hook up Completed handler, and call service asynchronously. Use Tab|Tab to auto-generated in VS client.SomeMethodCompleted += new EventHandler<SomeMethodCompletedEventArgs>(client_SomeMethodCompleted); client.SomeMethodAsync(myParam); ...   //Asynchronous result - display in UI. //Completed event handler gets called on UI thread it was created from. void client_SomeMethodCompleted(object sender, SomeMethodCompletedEventArgs e) { //Do something with e.Result; }     Thanks, Andy.

Threading, Blocking, Events, and Asynchronous Management

  
Alright.

I think I have finally broken it down to what logistically could be explained for many who have trouble dealing with threads.  Naturally, of course, I don't have the answer, but I think I have the question.  Threading is always a mind boggle at times, but what is more difficult that the concept of threads is executing it in a specific framework.

There are multiple ways to handle Threading in .Net, and my questions revolve around them all, but with specificity as to the "How to code it" as opposed to "Explain the concept."

One method of threading:  The BeginXXX/EndXXX with IAsyncResult
Assumed Given:  When Calling BeginXXX(CallBack) the Callback is executed on a Secondary Thread.  Thus whatever code exists within the Callback procedure must either be self-contained, thread protected (with locks etc), and/or Synchronized if being communicated to other threads (namely the calling thread).

Another Method of Threading: Using the Thread class, and providing a TreadProc() callback method.
Assumed Given:  The ThreadProc() method is handled similarly to the Callback of the BeginXXX/EndXXX style of threading.  The difference between the two is that the BeginXXX/EndXXX style uses the ThreadPool to manage the thread, where with the Thread Class we (the programmers) are ma

asynchronous call for data population in user control

  

i have a user control in which i want  to populate a drop down on blur event of text box asynchronously.. i tried with page method but it gives error as method is undefined.. then i tried with writing a web service..
and called a web service method in javascript on user control.. this also gives the same error as method is undefined...project is using master pages.. so the script manager is registered in master page..
so i added service reference as



ScriptManager sm = ScriptManager.GetCurrent(this.Page);
            sm.Services.Add(new ServiceReference("../Controls/MeetingTime.asmx"));

in user control...


below is my javascript call..

function getMeetingTime()
    {       
        
       var uclcmbUserId = document.getElementById('<%= uclcmbActiveClients.ClientID %>'+'<%= uclcmbActiveClients.ActualComboId%>');       
        
        try
        {   
        
   &

Problem with asynchronous call to webservice

  

Hello people.

I have a website where i call function in a web service. I am calling it asynchronously. The problem is the data which is returned from webservice is not shown in my label.

See here

protected void Page_Load(object sender, EventArgs e)
{
IAsyncResult asyncResult;

AsyncCallback callback = new AsyncCallback(MyCallBack);
asyncResult = serv.BeginGetImageList(req, callback, null);
}

private void MyCallBack(System.IAsyncResult asyncResult)
{

Label1.Text = "TEST";

}

Very simple but when the page is loaded, the label dont have any text.


Please help.


can any one help me how to use asynchronous call from linq Entity to sql in WPF.

  
can any one help me how to use asynchronous call from linq Entity to sql.
 when i click search i am calling background worker, on the back ground worker
 i want to call asynchronous method with database(because in my database i have too much value)
i am using linq entity frame work.when i click cancel button asynchronous will should stop .
can any one help me

joby James

can any one help me how to use asynchronous call from linq Entity to sql.

  
can any one help me how to use asynchronous call from linq Entity to sql.
 when i click search i am calling background worker, on the back ground worker
 i want to call asynchronous method with database(because in my database i have too much value)
i am using linq entity frame work.when i click cancel button asynchronous will should stop .
can any one help me

joby James

jQuery $(document).ready() and ASP.NET Ajax asynchronous postback

  
Many call it the ASP.NET jQuery postback problem, but using the technique below should make it no problem anymore. $(document).ready() isn't called after an asynchronous postback. What this means? You lose the functionality that should be executed within $(document).ready() after an UpdatePanel rendered its contents after an asynchronous postback.

call JavaScript - jQuery code from ASP.NET Server-Side

  
jQuery got so close to me lately that I can see myself adding the scripts to my project almost unconsciously. The thing is, jQuery is very useful for me, in almost all situations and it has been a do or die enhancement for all my project since I first put my hands on it.

Of course while using it, you encounter few situations which need a bit of research to solve, mostly when you are trying to combine it with some other technologies like: UpdatePanels and ASP.NET Ajax. For instance there are many situations when I would like to run some jQuery magic based on some decision that I make on the server side.

Using jQuery to directly call ASP.NET AJAX page methods

  
Here I am looking to explain how to call page methods using jQuery. Using jQuery to directly call ASP.NET AJAX page methods

jQuery live() and ASP.NET Ajax asynchronous postback

  
The issue is that normally $(document).ready() is called when the DOM is ready to be manipulated. But this doens't happen after an ASP.NET Ajax asynch postback occurs.

This means that the initial jQuery bindings won't be automatically available after the asynchronous postback is over. I underline "automatically" here because my last post describes more possibilities, how this issue can be worked around.

call JavaScript - jQuery code from ASP.NET Server-Side

  
jQuery got so close to me lately that I can see myself adding the scripts to my project almost unconsciously. The thing is, jQuery is very useful for me, in almost all situations and it has been a do or die enhancement for all my project since I first put my hands on it.

Of course while using it, you encounter few situations which need a bit of research to solve, mostly when you are trying to combine it with some other technologies like: UpdatePanels and ASP.NET Ajax. For instance there are many situations when I would like to run some jQuery magic based on some decision that I make on the server side

IP Address Blocking or Restriction in SQL Server

  
"is it possible to block connections to SQL Server based on IP address". As far as now there is no official way in SQL Server to block the connections in SQL Server based on IP address. However this can be done from the OS end, we have the following three options available, refer HERE for more.


.Firewall
.IPSec
.RRAS IP Filter

How to call an .exe file in .net

  
Sometimes a developer has to call an EXE from another EXE. While calling EXE there can be a requirement to pass parameter.

Cutting Edge: Revisiting Asynchronous ASP.NET Pages

  

If you need to scale up an existing Web application, you should first look to asynchronous operations, says Dino Esposito. He explains how new features coming in ASP.NET MVC 2 make this easier.

Dino Esposito

MSDN Magazine April 2010


Concurrent Affairs: Solving The Dining Philosophers Problem With Asynchronous Agents

  

We use the new Asynchronous Agents Library in Visual C++ 2010 to solve the classic Dining Philosophers concurrency problem.

Rick Molloy

MSDN Magazine June 2009


Windows with C++: Asynchronous WinHTTP.

  

This month's column explains how to use Windows HTTP Services, or WinHTTP, the new, powerful API for implementing HTTP clients.

Kenny Kerr

MSDN Magazine August 2008


.NET Matters: Asynchronous I/O with WebClient

  

In this month's installment of .NET Matters, columnist Stephen Toub answers reader questions concerning asynchronous I/O .

Stephen Toub

MSDN Magazine July 2008


Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend