By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,594 Members | 1,257 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,594 IT Pros & Developers. It's quick & easy.

Returning a DataTable blocks WCF-Service

P: n/a
Hello,

I recognized some days ago, that returning a DataTable blocks my
WCF-Service. Is this a known bug?
If I add this table to a new DataSet() and return this, it works.

Thank you,
Frank
Jun 27 '08 #1
Share this Question
Share on Google+
5 Replies


P: n/a
Hi Frank,

Yes, I agree that the problem is likely specific to something of the
components used here. Some simple DataTable/DataSet structure will not
quite repro the exact same behavior. Would you provide a sample class (used
to transfer in WCF method) that will cause such problem(even in a very
simply configured WCF service)? If the code is not convenient to paste on
web, you can email them as a solution to me so that I can test on my side.
You can reach me via the following email:

"stcheng" + @ + "microsoft.com"

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
ms****@microsoft.com.

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

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

--------------------
Date: Mon, 19 May 2008 08:14:07 +0200
From: Frank Hauptlorenz <ec***********@nospam.nospam>
User-Agent: Thunderbird 2.0.0.12 (Windows/20080213)
MIME-Version: 1.0
Subject: Re: Returning a DataTable blocks WCF-Service

Hello Steven,

it blocks until the time-out occurs. I think it's also not related to
the data itsself, maybe it's related to the
data structure. You can also reference the next post in this newsgroup,
it's the same topic.

Best wishes,
Frank

Steven Cheng [MSFT] schrieb:
Hi Frank,

As for the DataTable transfer in WCF, there hasn't known issue for
generic
DataTable object. I think the problem you encounter is possibly a
specific
problem. Since DataTable will contains data values(from database),
sometimes it might raise some problem if the raw data in the DataTable
get
error when being serialized during the request/response.

Have you tried different kind of data records(in the datatable) to see
whether the problem only occurs when the datatable carry some particular
kind of data? Also, for the blocking behavior, is it means a block until
timeout or just make the response very slow?

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you.
Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
ms****@microsoft.com.

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.
Jun 27 '08 #2

P: n/a
Dear Steven,

I've compiled a zip-archive with the server project and sent it to you
in some minutes.
Here are some hints:

The test method (operation contract) is this one:

public DataTable GetTestDataTableMethod()
{
DataTable tab = new
RECAROReportsMasterDataSet.ReportSettingsDataTable ();

return tab;
}

It just instantiates an EMPTY DataTable from an generated DataSet
(created with VS2008 and not manipulated).
The WCF-Connection times out after the return. You should be able to
read out all the WCF-Settings from the service project, or?
Thank you,
Frank
Steven Cheng [MSFT] schrieb:
Hi Frank,

Yes, I agree that the problem is likely specific to something of the
components used here. Some simple DataTable/DataSet structure will not
quite repro the exact same behavior. Would you provide a sample class (used
to transfer in WCF method) that will cause such problem(even in a very
simply configured WCF service)? If the code is not convenient to paste on
web, you can email them as a solution to me so that I can test on my side.
You can reach me via the following email:

"stcheng" + @ + "microsoft.com"

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
ms****@microsoft.com.

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

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

--------------------
Date: Mon, 19 May 2008 08:14:07 +0200
From: Frank Hauptlorenz <ec***********@nospam.nospam>
User-Agent: Thunderbird 2.0.0.12 (Windows/20080213)
MIME-Version: 1.0
Subject: Re: Returning a DataTable blocks WCF-Service

Hello Steven,

it blocks until the time-out occurs. I think it's also not related to
the data itsself, maybe it's related to the
data structure. You can also reference the next post in this newsgroup,
it's the same topic.

Best wishes,
Frank

Steven Cheng [MSFT] schrieb:
>Hi Frank,

As for the DataTable transfer in WCF, there hasn't known issue for
generic
>DataTable object. I think the problem you encounter is possibly a
specific
>problem. Since DataTable will contains data values(from database),
sometimes it might raise some problem if the raw data in the DataTable
get
>error when being serialized during the request/response.

Have you tried different kind of data records(in the datatable) to see
whether the problem only occurs when the datatable carry some particular
kind of data? Also, for the blocking behavior, is it means a block until
timeout or just make the response very slow?

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you.
Please
>feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
ms****@microsoft.com.

================================================= =
Get notification to my posts through email? Please refer to

http://msdn.microsoft.com/subscripti...ult.aspx#notif
>ications.
Jun 27 '08 #3

P: n/a
Hi Frank,

I've performed some tests according to your test solution. Yes, I've repro
the same behavior as you mentioned. Also, after some furter simplify and
isolation, the problem does be the DataTable type. Even if a very WCF
service method that return an empty DataTable will raise exception. I've
discussed with some other WCF engineers and found that there does exists
some problem with the WCF's serialization on DataTable if we return it
directly in WCF methods. Their suggestion now is that we try best to avoid
directly returning DataTable instance in WCF method, instead, we can
construct a Dataset object which contains the DataTable, and then return
the DataSet object instead. You can try this to see whether it helps.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
ms****@microsoft.com.

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
==================================================
This posting is provided "AS IS" with no warranties, and confers no
rights.--------------------
Date: Wed, 21 May 2008 08:43:27 +0200
From: Frank Hauptlorenz <ec***********@nospam.nospam>
User-Agent: Thunderbird 2.0.0.12 (Windows/20080213)
Dear Steven,

I've compiled a zip-archive with the server project and sent it to you
in some minutes.
Here are some hints:

The test method (operation contract) is this one:

public DataTable GetTestDataTableMethod()
{
DataTable tab = new
RECAROReportsMasterDataSet.ReportSettingsDataTable ();

return tab;
}

It just instantiates an EMPTY DataTable from an generated DataSet
(created with VS2008 and not manipulated).
The WCF-Connection times out after the return. You should be able to
read out all the WCF-Settings from the service project, or?
Thank you,
Frank
Steven Cheng [MSFT] schrieb:
Hi Frank,

Yes, I agree that the problem is likely specific to something of the
components used here. Some simple DataTable/DataSet structure will not
quite repro the exact same behavior. Would you provide a sample class
(used
to transfer in WCF method) that will cause such problem(even in a very
simply configured WCF service)? If the code is not convenient to paste
on
web, you can email them as a solution to me so that I can test on my
side.
You can reach me via the following email:

"stcheng" + @ + "microsoft.com"

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you.
Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
ms****@microsoft.com.

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

==================================================
This posting is provided "AS IS" with no warranties, and confers no
rights.
>
--------------------
Date: Mon, 19 May 2008 08:14:07 +0200
From: Frank Hauptlorenz <ec***********@nospam.nospam>
User-Agent: Thunderbird 2.0.0.12 (Windows/20080213)
MIME-Version: 1.0
Subject: Re: Returning a DataTable blocks WCF-Service

Hello Steven,

it blocks until the time-out occurs. I think it's also not related to
the data itsself, maybe it's related to the
data structure. You can also reference the next post in this newsgroup,
it's the same topic.

Best wishes,
Frank

Steven Cheng [MSFT] schrieb:
>Hi Frank,

As for the DataTable transfer in WCF, there hasn't known issue for
generic
>DataTable object. I think the problem you encounter is possibly a
specific
>problem. Since DataTable will contains data values(from database),
sometimes it might raise some problem if the raw data in the DataTable
get
>error when being serialized during the request/response.

Have you tried different kind of data records(in the datatable) to see
whether the problem only occurs when the datatable carry some particular
kind of data? Also, for the blocking behavior, is it means a block until
timeout or just make the response very slow?

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
Delighting our customers is our #1 priority. We welcome your comments
and
>suggestions about how we can improve the support we provide to you.
Please
>feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
ms****@microsoft.com.

================================================= =
Get notification to my posts through email? Please refer to

http://msdn.microsoft.com/subscripti...ult.aspx#notif
>
>ications.
Jun 27 '08 #4

P: n/a
Hello,

this is exactly my workaround I'm using (constructing an empty DataSet
and adding the table).
Will there be some changes in the WCF to support this in the future?

And besides: the WCF is a really great piece of software.

Best regards,
Frank
Steven Cheng [MSFT] schrieb:
Hi Frank,

I've performed some tests according to your test solution. Yes, I've repro
the same behavior as you mentioned. Also, after some furter simplify and
isolation, the problem does be the DataTable type. Even if a very WCF
service method that return an empty DataTable will raise exception. I've
discussed with some other WCF engineers and found that there does exists
some problem with the WCF's serialization on DataTable if we return it
directly in WCF methods. Their suggestion now is that we try best to avoid
directly returning DataTable instance in WCF method, instead, we can
construct a Dataset object which contains the DataTable, and then return
the DataSet object instead. You can try this to see whether it helps.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
ms****@microsoft.com.

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
==================================================
This posting is provided "AS IS" with no warranties, and confers no
rights.--------------------
Date: Wed, 21 May 2008 08:43:27 +0200
From: Frank Hauptlorenz <ec***********@nospam.nospam>
User-Agent: Thunderbird 2.0.0.12 (Windows/20080213)
Dear Steven,

I've compiled a zip-archive with the server project and sent it to you
in some minutes.
Here are some hints:

The test method (operation contract) is this one:

public DataTable GetTestDataTableMethod()
{
DataTable tab = new
RECAROReportsMasterDataSet.ReportSettingsDataTable ();

return tab;
}

It just instantiates an EMPTY DataTable from an generated DataSet
(created with VS2008 and not manipulated).
The WCF-Connection times out after the return. You should be able to
read out all the WCF-Settings from the service project, or?
Thank you,
Frank
Steven Cheng [MSFT] schrieb:
>Hi Frank,

Yes, I agree that the problem is likely specific to something of the
components used here. Some simple DataTable/DataSet structure will not
quite repro the exact same behavior. Would you provide a sample class
(used
>to transfer in WCF method) that will cause such problem(even in a very
simply configured WCF service)? If the code is not convenient to paste
on
>web, you can email them as a solution to me so that I can test on my
side.
>You can reach me via the following email:

"stcheng" + @ + "microsoft.com"

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you.
Please
>feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
ms****@microsoft.com.

================================================= =
Get notification to my posts through email? Please refer to

http://msdn.microsoft.com/subscripti...ult.aspx#notif
>ications.

================================================= =
This posting is provided "AS IS" with no warranties, and confers no
rights.
>--------------------
Date: Mon, 19 May 2008 08:14:07 +0200
From: Frank Hauptlorenz <ec***********@nospam.nospam>
User-Agent: Thunderbird 2.0.0.12 (Windows/20080213)
MIME-Version: 1.0
Subject: Re: Returning a DataTable blocks WCF-Service

Hello Steven,

it blocks until the time-out occurs. I think it's also not related to
the data itsself, maybe it's related to the
data structure. You can also reference the next post in this newsgroup,
it's the same topic.

Best wishes,
Frank

Steven Cheng [MSFT] schrieb:

>>Hi Frank,

As for the DataTable transfer in WCF, there hasn't known issue for

generic

>>DataTable object. I think the problem you encounter is possibly a

specific

>>problem. Since DataTable will contains data values(from database),
sometimes it might raise some problem if the raw data in the DataTable

get

>>error when being serialized during the request/response.

Have you tried different kind of data records(in the datatable) to see
whether the problem only occurs when the datatable carry some particular
kind of data? Also, for the blocking behavior, is it means a block until
timeout or just make the response very slow?

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
Delighting our customers is our #1 priority. We welcome your comments
and
>>suggestions about how we can improve the support we provide to you.

Please

>>feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
ms****@microsoft.com.

================================================ ==
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
>>
>>ications.


Jun 27 '08 #5

P: n/a
Thanks for your reply Frank,

Yes, I agree with you that WCF is one of the greatest feature involved in
the new .NET framework components. Actually I think its programming model
is quite clear and unified. That make it much easier to understand and use
comparing to many other existing distributed computing component such as
.net remoting , webservice.

Anyway, for this issue, I think the dev team has also noticed this since
I've also found some information of this issue from some MS engineer's
blog. I would also suggest you submit it to the connect feedback site since
the dev team will constantly monitor the issues and feedback there so as to
consider features for future improvement.

#Visual Studio and .NET Framework - English
http://connect.microsoft.com/feedbac...spx?SiteID=210

Thanks again for your posting.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
ms****@microsoft.com.

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

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

--------------------
Date: Mon, 26 May 2008 12:51:30 +0200
From: Frank Hauptlorenz <ec***********@nospam.nospam>
User-Agent: Thunderbird 2.0.0.14 (Windows/20080421)
MIME-Version: 1.0
Subject: Re: Returning a DataTable blocks WCF-Service
Hello,

this is exactly my workaround I'm using (constructing an empty DataSet
and adding the table).
Will there be some changes in the WCF to support this in the future?

And besides: the WCF is a really great piece of software.

Best regards,
Frank
Jun 27 '08 #6

This discussion thread is closed

Replies have been disabled for this discussion.