473,395 Members | 1,948 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 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 4054
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 WSDL defines the output as an Object so I was...
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: System.InvalidOperationException Message: The...
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 method of my vb source : ...
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 validate(string url, XmlDocument 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 with no problems. When I try to add the...
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 parameter1); When calling this method I receive the...
3
by: Joseph Geretz | last post by:
System.InvalidOperationException: WebServiceBindingAttribute is required on proxy classes. My environment: Visual Studio 2005, targeting FX 2.0; I've developed a Web Service which uses DIME to...
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: No connection could be made because the target...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.