Error in asynchronous call back function

G

Guest

I am working on calling a web service asynchronously with a callback delegate. The web service is returning an error, which I am catching in the callback function. The issue is that the Exception object is returning an empty message. Is this a bug?

CODE:

Here is the initial call

mywebservice.Service1 ws = new mywebservice.Service1();
AsyncCallback cb = new AsyncCallback(WSCallback);
MyState mystate = new MyState(ws,Session.SessionID);
ws.BeginLongRunningTask(15000,cb,mystate);


Here is the Callback

try
{
MyState mystate = (MyState) ar.AsyncState;
mywebservice.Service1 ws = mystate._webservicestate;
TempDataStore.SetRecords(mystate._sessionid,ws.EndLongRunningTask(ar));
}
catch(Exception ex)
{
// The ex.message is empty
this.Label1.Text = ex.Message;
}

Thanks!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top