Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Services > Problem Passing DataSet through Async Proxy

Reply
Thread Tools

Problem Passing DataSet through Async Proxy

 
 
Dustin
Guest
Posts: n/a
 
      12-23-2004
All,

I have a windows service that passes a dataset to a webmethod. The
webmethod then puts the dataset into a private message queue. I
created the proxy for the webmethod in visual studio, by adding a
reference to the webmethod, not using wsdl.exe manually.

Initially I flushed out the code calling the synchronous version of the
generated proxy for the webmethod. This worked fine and I was able to
see the datasets transferred properly to the private queue via the
webmethod.

Subsequently I changed the implementation to use the asynchronous
version of the webmethod's proxy. Everything seemed to be working
fine, datasets were arriving in the private queue and callbacks firing
fine.

Today I implemented the queue drainer and found that there were no rows
in the datasets that I was pulling out of the private queue. After
awhile I traced it back to the fact that there were no rows in the
dataset received by the webmethod. It turns out that if I revert to
calling the synchronous version of the proxy, the dataset is properly
transferred (with rows) to the webmethod and subsequently to the
private queue.

I have attempted to regenerate the proxy and there is no change in
behavior.

This seems quite odd. Does anyone have reference indicating that a
difference exists between the serialization performed on datasets in
synchronous calls vs. asynchronous calls?

Thanks in advance,

Dustin
Newbrook Solutions
www.newbrooksolutions.com

 
Reply With Quote
 
 
 
 
Dan Rogers
Guest
Posts: n/a
 
      01-04-2005
Hi Dustin,

I think I saw ar related thread a while back. There are apparently
threading access issues that are intrinsic to data sets - but this is just
anecdotal based on threads I saw discussing this at an earlier time. I
would suspect that the second thread that is servicing the background call
is unable to read the data from the dataset that was created by the
foreground thread.

As a remedy, try serializing the dataset to XML, and then passing the
XMLDocument to the web method in your proxy.

I hope this helps

Dan Rogers
Microsoft Corporation
--------------------
>From: "Dustin" <(E-Mail Removed)>
>Newsgroups: microsoft.public.dotnet.framework.aspnet.webservic es
>Subject: Problem Passing DataSet through Async Proxy
>Date: 22 Dec 2004 20:23:40 -0800
>Organization: http://groups.google.com
>Lines: 38
>Message-ID: <(E-Mail Removed) .com>
>NNTP-Posting-Host: 68.235.175.182
>Mime-Version: 1.0
>Content-Type: text/plain; charset="iso-8859-1"
>X-Trace: posting.google.com 1103775825 7642 127.0.0.1 (23 Dec 2004

04:23:45 GMT)
>X-Complaints-To: http://www.velocityreviews.com/forums/(E-Mail Removed)
>NNTP-Posting-Date: Thu, 23 Dec 2004 04:23:45 +0000 (UTC)
>User-Agent: G2/0.2
>Complaints-To: (E-Mail Removed)
>Injection-Info: z14g2000cwz.googlegroups.com; posting-host=68.235.175.182;
> posting-account=RQCAeA0AAAD3LqKwWkK7dT5s5xKt50OA
>Path:

cpmsftngxa10.phx.gbl!TK2MSFTFEED02.phx.gbl!tornado .fastwebnet.it!tiscali!new
sfeed1.ip.tiscali.net!news.glorb.com!postnews.goog le.com!z14g2000cwz.googleg
roups.com!not-for-mail
>Xref: cpmsftngxa10.phx.gbl

microsoft.public.dotnet.framework.aspnet.webservic es:27371
>X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webservic es
>
>All,
>
>I have a windows service that passes a dataset to a webmethod. The
>webmethod then puts the dataset into a private message queue. I
>created the proxy for the webmethod in visual studio, by adding a
>reference to the webmethod, not using wsdl.exe manually.
>
>Initially I flushed out the code calling the synchronous version of the
>generated proxy for the webmethod. This worked fine and I was able to
>see the datasets transferred properly to the private queue via the
>webmethod.
>
>Subsequently I changed the implementation to use the asynchronous
>version of the webmethod's proxy. Everything seemed to be working
>fine, datasets were arriving in the private queue and callbacks firing
>fine.
>
>Today I implemented the queue drainer and found that there were no rows
>in the datasets that I was pulling out of the private queue. After
>awhile I traced it back to the fact that there were no rows in the
>dataset received by the webmethod. It turns out that if I revert to
>calling the synchronous version of the proxy, the dataset is properly
>transferred (with rows) to the webmethod and subsequently to the
>private queue.
>
>I have attempted to regenerate the proxy and there is no change in
>behavior.
>
>This seems quite odd. Does anyone have reference indicating that a
>difference exists between the serialization performed on datasets in
>synchronous calls vs. asynchronous calls?
>
>Thanks in advance,
>
>Dustin
>Newbrook Solutions
>www.newbrooksolutions.com
>
>


 
Reply With Quote
 
 
 
 
Dustin
Guest
Posts: n/a
 
      01-04-2005

Dan Rogers wrote:
> Hi Dustin,
>
> I think I saw ar related thread a while back. There are apparently
> threading access issues that are intrinsic to data sets - but this is

just
> anecdotal based on threads I saw discussing this at an earlier time.

I
> would suspect that the second thread that is servicing the background

call
> is unable to read the data from the dataset that was created by the
> foreground thread.
>
> As a remedy, try serializing the dataset to XML, and then passing the


> XMLDocument to the web method in your proxy.
>
> I hope this helps
>
> Dan Rogers
> Microsoft Corporation
> --------------------
> >From: "Dustin" <(E-Mail Removed)>
> >Newsgroups: microsoft.public.dotnet.framework.aspnet.webservic es
> >Subject: Problem Passing DataSet through Async Proxy
> >Date: 22 Dec 2004 20:23:40 -0800
> >Organization: http://groups.google.com
> >Lines: 38
> >Message-ID: <(E-Mail Removed) .com>
> >NNTP-Posting-Host: 68.235.175.182
> >Mime-Version: 1.0
> >Content-Type: text/plain; charset="iso-8859-1"
> >X-Trace: posting.google.com 1103775825 7642 127.0.0.1 (23 Dec 2004

> 04:23:45 GMT)
> >X-Complaints-To: (E-Mail Removed)
> >NNTP-Posting-Date: Thu, 23 Dec 2004 04:23:45 +0000 (UTC)
> >User-Agent: G2/0.2
> >Complaints-To: (E-Mail Removed)
> >Injection-Info: z14g2000cwz.googlegroups.com;

posting-host=68.235.175.182;
> > posting-account=RQCAeA0AAAD3LqKwWkK7dT5s5xKt50OA
> >Path:

>

cpmsftngxa10.phx.gbl!TK2MSFTFEED02.phx.gbl!tornado .fastwebnet.it!tiscali!new
>

sfeed1.ip.tiscali.net!news.glorb.com!postnews.goog le.com!z14g2000cwz.googleg
> roups.com!not-for-mail
> >Xref: cpmsftngxa10.phx.gbl

> microsoft.public.dotnet.framework.aspnet.webservic es:27371
> >X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webservic es
> >
> >All,
> >
> >I have a windows service that passes a dataset to a webmethod. The
> >webmethod then puts the dataset into a private message queue. I
> >created the proxy for the webmethod in visual studio, by adding a
> >reference to the webmethod, not using wsdl.exe manually.
> >
> >Initially I flushed out the code calling the synchronous version of

the
> >generated proxy for the webmethod. This worked fine and I was able

to
> >see the datasets transferred properly to the private queue via the
> >webmethod.
> >
> >Subsequently I changed the implementation to use the asynchronous
> >version of the webmethod's proxy. Everything seemed to be working
> >fine, datasets were arriving in the private queue and callbacks

firing
> >fine.
> >
> >Today I implemented the queue drainer and found that there were no

rows
> >in the datasets that I was pulling out of the private queue. After
> >awhile I traced it back to the fact that there were no rows in the
> >dataset received by the webmethod. It turns out that if I revert to
> >calling the synchronous version of the proxy, the dataset is

properly
> >transferred (with rows) to the webmethod and subsequently to the
> >private queue.
> >
> >I have attempted to regenerate the proxy and there is no change in
> >behavior.
> >
> >This seems quite odd. Does anyone have reference indicating that a
> >difference exists between the serialization performed on datasets in
> >synchronous calls vs. asynchronous calls?
> >
> >Thanks in advance,
> >
> >Dustin
> >Newbrook Solutions
> >www.newbrooksolutions.com
> >
> >


I found that the error was occuring due to a race condition. The
BeginInvoke() method of the proxy does not generate a deep copy of the
DataSet. I was making a call to the DataSet.Clear() method after
calling my web proxy. In the synchronous call this works fine as the
dataset has already been serialized and sent. In the asynchronous call
it causes the DataSet to be cleared before the DataSet is actually
serialized down (at least this is my best guess). I removed the call to
DataSet.Clear() and it is working fine.

Dustin

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Newbie: async mode dedicated versus async mode interactive!! Pink_Floyd Cisco 4 06-16-2006 12:16 AM
Async webservice call in async webpage (.Net 2.0) does not return Steven ASP .Net Web Services 0 11-30-2005 01:06 AM
Typed dataset returned from webservice incorrectly defined in proxy - null value problem Randy Hayes ASP .Net Web Services 1 01-20-2004 02:51 AM
Typed dataset returned from webservice incorrectly defined in proxy - null value problem Randy Hayes ASP .Net Web Services 0 12-21-2003 04:59 PM
Async Message Passing Mechanism Wanted John Ramsden Perl Misc 0 06-25-2003 02:59 PM



Advertisments