472,353 Members | 1,995 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,353 software developers and data experts.

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 3967
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Stacey Levine | last post by:
I have a webservice that I wanted to return an ArrayList..Well the service compiles and runs when I have the output defined as ArrayList, but the...
0
by: John.Luckowsky | last post by:
Hello all, I've moved my old ASP1.1 with WSE2.0 SP3 to ASP2.0 and have found strange error which raises spontaneously. Here is the stack trace: ...
3
by: Olivier BESSON | last post by:
Hello, I have a web service of my own on a server (vb.net). I must declare it with SoapRpcMethod to be used with JAVA. This is a simple exemple...
2
by: John Smith | last post by:
I'm writing webervice client using .Net 2.0. I have this class: public class MyWebService : SoapHttpClientProtocol { public XmlDocument...
4
by: John Smith | last post by:
How can I allow someone to cast my C# class into System.String? Is it possible in C#? In C++ I used "operator" keyword to mark C++ member function.
0
by: nicomp | last post by:
I created a Web Service: I imported System.Data.SqlClient so I could access SQL server tables programmatically. The web service builds and deploys...
5
by: Michael Primeaux | last post by:
I have a simple .NET 2.0 web service created with VS.NET 2005 with a single web method with the following signature: void HelloWorld(Guid...
3
by: Joseph Geretz | last post by:
System.InvalidOperationException: WebServiceBindingAttribute is required on proxy classes. My environment: Visual Studio 2005, targeting FX 2.0;...
4
by: sd1978 | last post by:
Hi, I have placed a webservice in the webserver. When I access it from a webpage, default.aspx on a click of a button i get the following error: ...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
0
jalbright99669
by: jalbright99669 | last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific...
0
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand....
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.