469,953 Members | 2,256 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,953 developers. It's quick & easy.

System.Web.Services exception

Hi all,

I have a windows app that makes some asyc calls to my webservice
(WSE 3.0 with MTOM).
>From time to time when the user cancels the async call, the following
exception gets thrown in the client win app. This exception is being
thrown on another thread by a class in the System.Web.Services
namespace and I have not been able to
catch it and dispose of it. I've tried placing try/catch blocks in
several places in my code, but this exception doesn't seem to bubble
up the stack.
How can catch and gracefully handle this exception?

Any help greatly appreciated.
Rich
for reference my completed event handler:

private void proxy_DoSomethingCompleted(object sender,
DoSomethingCompletedEventArgs Completed)
{
if(!Completed.Cancelled)
{
if (Completed.Error == null)
{
// do something with the Completed.Results
}
}

}
The Excpeption being thrown:

System.InvalidOperationException was unhandled
Message="There was an error during async processing."
Source="System.Web.Services"
StackTrace:
at
System.Web.Services.Protocols.WebClientProtocol.Pr ocessAsyncException(WebCl**
ientAsyncResult
client, Exception e)
at
System.Web.Services.Protocols.WebClientProtocol.Re adResponseAsyncCallback(I**
AsyncResult
asyncResult)
at System.Net.LazyAsyncResult.Complete(IntPtr userToken)
at System.Net.ContextAwareResult.CompleteCallback(Obj ect
state)
at System.Threading.ExecutionContext.runTryCode(Objec t
userData)
at
System.Runtime.CompilerServices.RuntimeHelpers.Exe cuteCodeWithGuaranteedCle**
anup(TryCode
code, CleanupCode backoutCode, Object userData)
at
System.Threading.ExecutionContext.RunInternal(Exec utionContext
executionContext, ContextCallback callback, Object state)
at System.Threading.ExecutionContext.Run(ExecutionCon text
executionContext, ContextCallback callback, Object state)
at System.Net.ContextAwareResult.Complete(IntPtr userToken)
at System.Net.LazyAsyncResult.ProtectedInvokeCallback (Object
result, IntPtr userToken)
at
System.Net.Sockets.BaseOverlappedAsyncResult.Compl etionPortCallback(UInt32
errorCode, UInt32 numBytes, NativeOverlapped* nativeOverlapped)
at
System.Threading._IOCompletionCallback.PerformIOCo mpletionCallback(UInt32
errorCode, UInt32 numBytes, NativeOverlapped* pOVERLAP)

Apr 20 '07 #1
2 3853
Correct me if I misinterpret you. The problem appears to be that an
exception is thrown in another thread than the thread that should
handle it. The solution for such a problem therefore involves storing
the exception and having the handling thread check (or signal/wait) if
a problem has occurred. You can use polling (don't forget a lock on
the shared object) or a Monitor for these kind of things.

Does this help?

Cheers,
Stefan.

On 20 apr, 02:58, koredump <kored...@interia.plwrote:
Hi all,

I have a windows app that makes some asyc calls to my webservice
(WSE 3.0 with MTOM).>From time to time when the user cancels the async call, the following

exception gets thrown in the client win app. This exception is being
thrown on another thread by a class in the System.Web.Services
namespace and I have not been able to
catch it and dispose of it. I've tried placing try/catch blocks in
several places in my code, but this exception doesn't seem to bubble
up the stack.
How can catch and gracefully handle this exception?

Any help greatly appreciated.

Rich

for reference my completed event handler:

private void proxy_DoSomethingCompleted(object sender,
DoSomethingCompletedEventArgs Completed)
{
if(!Completed.Cancelled)
{
if (Completed.Error == null)
{
// do something with the Completed.Results
}

}

}

The Excpeption being thrown:

System.InvalidOperationException was unhandled
Message="There was an error during async processing."
Source="System.Web.Services"
StackTrace:
at
System.Web.Services.Protocols.WebClientProtocol.Pr ocessAsyncException(WebCl**
ientAsyncResult
client, Exception e)
at
System.Web.Services.Protocols.WebClientProtocol.Re adResponseAsyncCallback(I**
AsyncResult
asyncResult)
at System.Net.LazyAsyncResult.Complete(IntPtr userToken)
at System.Net.ContextAwareResult.CompleteCallback(Obj ect
state)
at System.Threading.ExecutionContext.runTryCode(Objec t
userData)
at
System.Runtime.CompilerServices.RuntimeHelpers.Exe cuteCodeWithGuaranteedCle**
anup(TryCode
code, CleanupCode backoutCode, Object userData)
at
System.Threading.ExecutionContext.RunInternal(Exec utionContext
executionContext, ContextCallback callback, Object state)
at System.Threading.ExecutionContext.Run(ExecutionCon text
executionContext, ContextCallback callback, Object state)
at System.Net.ContextAwareResult.Complete(IntPtr userToken)
at System.Net.LazyAsyncResult.ProtectedInvokeCallback (Object
result, IntPtr userToken)
at
System.Net.Sockets.BaseOverlappedAsyncResult.Compl etionPortCallback(UInt32
errorCode, UInt32 numBytes, NativeOverlapped* nativeOverlapped)
at
System.Threading._IOCompletionCallback.PerformIOCo mpletionCallback(UInt32
errorCode, UInt32 numBytes, NativeOverlapped* pOVERLAP)

Apr 20 '07 #2
On Apr 20, 2:28 am, atlaste <atla...@gmail.comwrote:
Correct me if I misinterpret you. The problem appears to be that an
exception is thrown in another thread than the thread that should
handle it. The solution for such a problem therefore involves storing
the exception and having the handling thread check (or signal/wait) if
a problem has occurred. You can use polling (don't forget a lock on
the shared object) or a Monitor for these kind of things.

Does this help?

Cheers,
Stefan.

On 20 apr, 02:58, koredump <kored...@interia.plwrote:
Hi all,
I have a windows app that makes some asyc calls to my webservice
(WSE 3.0 with MTOM).>From time to time when the user cancels the async call, the following
exception gets thrown in the client win app. This exception is being
thrown on another thread by a class in the System.Web.Services
namespace and I have not been able to
catch it and dispose of it. I've tried placing try/catch blocks in
several places in my code, but this exception doesn't seem to bubble
up the stack.
How can catch and gracefully handle this exception?
Any help greatly appreciated.
Rich
for reference my completed event handler:
private void proxy_DoSomethingCompleted(object sender,
DoSomethingCompletedEventArgs Completed)
{
if(!Completed.Cancelled)
{
if (Completed.Error == null)
{
// do something with the Completed.Results
}
}
}
The Excpeption being thrown:
System.InvalidOperationException was unhandled
Message="There was an error during async processing."
Source="System.Web.Services"
StackTrace:
at
System.Web.Services.Protocols.WebClientProtocol.Pr ocessAsyncException(WebCl***
ientAsyncResult
client, Exception e)
at
System.Web.Services.Protocols.WebClientProtocol.Re adResponseAsyncCallback(I***
AsyncResult
asyncResult)
at System.Net.LazyAsyncResult.Complete(IntPtr userToken)
at System.Net.ContextAwareResult.CompleteCallback(Obj ect
state)
at System.Threading.ExecutionContext.runTryCode(Objec t
userData)
at
System.Runtime.CompilerServices.RuntimeHelpers.Exe cuteCodeWithGuaranteedCle***
anup(TryCode
code, CleanupCode backoutCode, Object userData)
at
System.Threading.ExecutionContext.RunInternal(Exec utionContext
executionContext, ContextCallback callback, Object state)
at System.Threading.ExecutionContext.Run(ExecutionCon text
executionContext, ContextCallback callback, Object state)
at System.Net.ContextAwareResult.Complete(IntPtr userToken)
at System.Net.LazyAsyncResult.ProtectedInvokeCallback (Object
result, IntPtr userToken)
at
System.Net.Sockets.BaseOverlappedAsyncResult.Compl etionPortCallback(UInt32
errorCode, UInt32 numBytes, NativeOverlapped* nativeOverlapped)
at
System.Threading._IOCompletionCallback.PerformIOCo mpletionCallback(UInt32
errorCode, UInt32 numBytes, NativeOverlapped* pOVERLAP)- Hide quoted text -

- Show quoted text -

Thanks Stefan,
You've pointed me in the right direction.

Rich

Apr 22 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by John.Luckowsky | last post: by
4 posts views Thread by John Smith | last post: by
5 posts views Thread by Michael Primeaux | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.