SetColumnError/RowError & Webservice Parameters

J

Jamie Dulaney

Background
-------------
I have attempted to use the "SetColumnError" and/or "RowError" methods in
order to post error text about specific error conditions that were found
during the editing of rows that were either added or updated in an ADO.NET
dataset->datatable->datarow... I'm using 'typed' datasets and I'm passing
these typed datasets between webforms and webservices.. Framework 1.1/VS
2003/C#.

Problem
---------
I have discovered when I post error text with these methods (either at the
column or the row level WITHIN THE WEB SERVICE) then subsequent parameters
that get passed from my webservices get corrupted. A cheap example
webservice call would look like the following:

WebServiceA.UpdateCustomer ref dsCustomers,
out dsMessages

Note: I realize the above won't compile... trying to keep the rif raf
down. Basically two parameters, both typed datasets. First one will be
editted and contain errors.

The dsCustomers would have some sort of errors on rows that were targeted to
be inserted/updated. The code that allows me to SetColumnError(x,"yyyyy")
or RowError = "yyyyy". Would have 'marked' this column/row object. No
problem during the edit identification and error text posting process.

However, when the webservice returns control to the calling function the
last parameter dsMessages (in the example above) becomes <undefined> and it
subsequently throws a null object exception. BTW.. when tracing in debugger
it is assigned and defined just prior to the return. There is definantly
something wrong with setting the error text AND maintaining integrity of the
memory.


Just wondering if anyone else has seen this AND/OR maybe can shed some light
on it ???? I couldn't find much through ms newsgroup and/or google searchs
on this...
 
K

Kevin Yu [MSFT]

Hi Jamie,

Thank you for posting in the community!

First of all, I would like to confirm my understanding of your issue. From
your description, I understand that you need to return a DataSet dsMessages
as an out parameter in the web method. If there is any misunderstanding,
please feel free to let me know.

Based on my experience, the web method has to return the correct DataSet if
all code are correct. I have done some research according to your
description. However, I cannot reproduce it on my machine. Generally, we
can step into the web method and use the watch window to track the value of
dsMessages. We can see if we have assigned the proper value to it before
returning from the web method. This might help to isolate the problem,
which makes it clear whether the problem lies in the web method or the
client which consumes the web service.

I think it might be helpful for me to make futher troubleshooting for your,
if you could paste both the web method code and the client code here. Thank
you for your cooperation.

If anything is unclear, please feel free to reply to the post.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."
 
J

Jamie Dulaney

Thanks Kevin, I sent you zipped code files and explanations of each in
separate email to your email address...
 
K

Kevin Yu [MSFT]

Hi Jamie,

I have checked your code. It was hard for me to debug it, because I cannot
get the whole solution to build. Here I have some suggestions on this.
Could you set some breakpoints in the UpdateEmployees method and step
through it to see if the tempMessages.MessageDataset has been properly set
to a valid object before it is returned with an output parameter. Please
pause at each point that might make modifications to
tempMessages.MessageDataset and use the watch window to monitor its value.
It might be more helpful for us to see where is the error caused. Thank you
for your cooperation!

If anything is unclear, please feel free to reply to the post.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."
 

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

Top