how to make asynchronous call to web service when its OneWay property is set to true.

R

RK

I have web service with the following signature

[SoapDocumentMethod(OneWay=true)]
[WebMethod]
public void Update(XmlElement objElement)
{
//
//call another C# library that update the Oracle database
//this method also calls another C# libray that interacts with
application
//(which talks to legacy system)
//this method takes considerable amount of time.
//
}

in my aspx page I want to call this webservice asynchronously, and
then redirects to another page.

I tried all the three options for making asynchronous calls.
1) polling for completion --- checking IAsyncResult.IsCompleted before
calling endUpdate method
2) using WaitHandles - IAsyncResult.AsyncWaitHandle.WaitOne() method
before calling endUpdate method.
3) using callback delegate.

all the three options allowing me go to next page, but database doesnt
get updated. When I debug webservice is throwing exception

An unhandled exception of type
'System.Reflection.TargetInvocationException' occurred in unknown
module. Exception has been thrown by the target of invocation.

if I take out SoapDocumentMethod(OneWay=true), its fine and everything
is working, but I want this method gets executed in the background
while aspx page redirected to another page. Could anybody help me.

thanks in advance.
RK
 

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

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top