通过Web服务返回数据集或数据表 [英] Returning Dataset or Datatable via Web Service

查看:67
本文介绍了通过Web服务返回数据集或数据表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对当前建议不要在应用程序层之间发送数据集或

数据表感到困惑。

http://support.microsoft.com/kb/306134

http://msdn2.microsoft.com/en-us/library/ms996381.aspx


以前,使用经典的Microsoft DNA架构,ADO Recordset是一个

主要传输介质,建议用于在
$之间传输数据b $ b申请层。事实上,有关于这个主题的全部书籍。


所以,我有点疑惑为什么这个没有被推进到ADO.NET中。在

任何情况下,推荐的替代方案是什么?手动序列化和

传递XML?那么为什么我们不能自动发生这种情况,就像带有经典ADO记录集的

情况一样?


感谢您的建议?

- Joseph Geretz -

I''m a bit puzzled by the current recommendation not to send Datasets or
Datatables between application tiers.

http://support.microsoft.com/kb/306134

http://msdn2.microsoft.com/en-us/library/ms996381.aspx

Formerly, with classic Microsoft DNA architecture, the ADO Recordset was a
primary transport medium, recommended for transmitting data between
application tiers. In fact, there are whole books written on the subject.

So, I''m a bit puzzled why this hasn''t been carried forward into ADO.NET. In
any case, what then is the recommended alternative? Manually serialize and
pass the XML? So why can''t this happen automatically for us, just as was the
case with classic ADO recordsets?

Thanks for your advice?

- Joseph Geretz -

推荐答案

Joseph Geretz,


微软网站中提到的错误消息是出于不同的原因。
你可以传回DataSet / DataTable&在web服务之间。

ADO.NET 2.0支持DataSet / DataTable序列化。

我没有找到使用它的任何限制


-

谢谢&此致,

Mark Nelson

" Joseph Geretz"写道:
Joseph Geretz,

The error message mentioned in the microsoft site is for a different cause.
You can pass DataSet / DataTable back & forth between web service.
The DataSet / DataTable serialization is supported in ADO.NET 2.0.
I''m not finding any restriction to use theam

--
Thanks & Regards,
Mark Nelson
"Joseph Geretz" wrote:

我对当前建议不要发送数据集或

应用程序层之间的数据表感到有点困惑。

http://support.microsoft.com/kb/306134

http:// msdn2 .microsoft.com / zh-CN / library / ms996381.aspx

以前,使用经典的Microsoft DNA架构,ADO Recordset是一个

主要传输介质,建议在

应用程序层之间传输数据。事实上,有关于这个主题的全部书籍。


所以,我有点疑惑为什么这个没有被推进到ADO.NET中。在

任何情况下,推荐的替代方案是什么?手动序列化和

传递XML?那么为什么我们不能自动发生这种情况,就像带有经典ADO记录集的

情况一样?


感谢您的建议?

- Joseph Geretz -
I''m a bit puzzled by the current recommendation not to send Datasets or
Datatables between application tiers.

http://support.microsoft.com/kb/306134

http://msdn2.microsoft.com/en-us/library/ms996381.aspx

Formerly, with classic Microsoft DNA architecture, the ADO Recordset was a
primary transport medium, recommended for transmitting data between
application tiers. In fact, there are whole books written on the subject.

So, I''m a bit puzzled why this hasn''t been carried forward into ADO.NET. In
any case, what then is the recommended alternative? Manually serialize and
pass the XML? So why can''t this happen automatically for us, just as was the
case with classic ADO recordsets?

Thanks for your advice?

- Joseph Geretz -


嗨Mark,


我没有'不能说它不会起作用。它确实有效。但是不建议这样做:

http://msdn2.microsoft.com/en-us/lib...emotes_topic11

避免在服务之间传递数据集


在我们的测试中,选择服务和呼叫者交换数据的方式 - 比如数据集或序列化结构 - 产生了更大的性能

影响比选择任何特定的分布式系统技术

另一个。


从性能角度来看,我们强烈建议您限制使用

DataSet作为应用程序部分的数据传输机制,其中确实需要它们,并且您选择[Serializable]结构

尽可能。


ADO.NET DataSet提供了一种很好的方法来检索,操作,排序和分析
形状数据,将其存储在本地以供离线使用和同步onize将
更改回中央数据库。如果这是您的应用程序的要求,那么

当然,这是一个有效的选择。在.NET Framework 1.x中,DataSet

值始终被序列化为XML(即使您声明您需要它们

序列化为二进制或与ES一起使用它们或Remoting),它们还包含描述数据的XSD
。当然,这会影响性能。


更重要的是,请记住,DataSet是一种特定于.NET的技术,并且将会大大限制您的互操作性因为其他平台不会

必须能够序列化和解析包含序列化数据的数据

数据集。


你可以获得通过交换

序列化数据结构来提高性能。内置的运行时格式和XML

序列化框架使其变得简单,如上面的测试所示。


- Joe Geretz -


" Mark Nelson" < Ma ******** @ discussion.microsoft.com写信息

新闻:4F ******************** ************** @ microsof t.com ...
Hi Mark,

I didn''t say it wouldn''t work. It does work. But it''s not recommended:

http://msdn2.microsoft.com/en-us/lib...emotes_topic11

Avoid passing DataSets between services

In our tests, choosing the way the services and callers exchange data-as
DataSets or serialized structures-resulted in a much bigger performance
impact than choosing any particular distributed systems technology over
another.

From a performance perspective, we strongly urge you to limit your use of
DataSets as a data transfer mechanism to the parts of your application where
they are truly needed and that you opt for [Serializable] structures
wherever possible.

ADO.NET DataSets provide a great way to retrieve, manipulate, sort, and
shape data, store it locally for offline use, and synchronize changes back
into a central database. If this is a requirement of your application, then
of course, it''s a valid choice to make. In the .NET Framework 1.x, DataSet
values are always serialized to XML (even if you state that you want them
serialized as binary or use them with ES or Remoting), and they also contain
the XSD describing the data. This, of course, impacts performance.

What''s more, remember that DataSets are a .NET-specific technology and will
significantly limit your interoperability as other platforms won''t
necessarily be able to serialize and parse data containing serialized
DataSets.

You can gain considerable performance improvements by instead exchanging
serialized data structures. The built-in runtime formatting and XML
serialization framework makes it easy, as shown in the tests above.

- Joe Geretz -

"Mark Nelson" <Ma********@discussions.microsoft.comwrote in message
news:4F**********************************@microsof t.com...

Joseph Geretz,


microsoft站点中提到的错误消息是针对不同的原因。
您可以将DataSet / DataTable传递回来&在web服务之间。

ADO.NET 2.0支持DataSet / DataTable序列化。

我没有找到使用它的任何限制


-

谢谢&此致,

Mark Nelson


" Joseph Geretz"写道:
Joseph Geretz,

The error message mentioned in the microsoft site is for a different
cause.
You can pass DataSet / DataTable back & forth between web service.
The DataSet / DataTable serialization is supported in ADO.NET 2.0.
I''m not finding any restriction to use theam

--
Thanks & Regards,
Mark Nelson
"Joseph Geretz" wrote:

>我对当前建议不要在应用程序层之间发送数据集或
数据表感到困惑。

http://support.microsoft.com/kb/306134 <

http://msdn2.microsoft .com / zh-CN / library / ms996381.aspx

以前,使用经典的Microsoft DNA架构,ADO Recordset是一种主要的传输介质,推荐使用在
应用程序层之间传输数据。事实上,有关于这个主题的全书都有。

所以,我有点疑惑为什么这个没有被推进ADO.NET。

无论如何,推荐的替代方案是什么?手动序列化

传递XML?那么为什么我们不能自动发生这种情况,就像经典ADO记录集的情况一样?

感谢您的建议?
- Joseph Geretz -
>I''m a bit puzzled by the current recommendation not to send Datasets or
Datatables between application tiers.

http://support.microsoft.com/kb/306134

http://msdn2.microsoft.com/en-us/library/ms996381.aspx

Formerly, with classic Microsoft DNA architecture, the ADO Recordset was
a
primary transport medium, recommended for transmitting data between
application tiers. In fact, there are whole books written on the subject.

So, I''m a bit puzzled why this hasn''t been carried forward into ADO.NET.
In
any case, what then is the recommended alternative? Manually serialize
and
pass the XML? So why can''t this happen automatically for us, just as was
the
case with classic ADO recordsets?

Thanks for your advice?

- Joseph Geretz -



" Joseph Geretz" < jg ***** @ nospam.com写信息

新闻:OY ************** @ TK2MSFTNGP04.phx.gbl ...
"Joseph Geretz" <jg*****@nospam.comwrote in message
news:OY**************@TK2MSFTNGP04.phx.gbl...

我对当前建议不要发送数据集或

应用程序层之间的数据表感到有些困惑。
I''m a bit puzzled by the current recommendation not to send Datasets or
Datatables between application tiers.



约瑟夫,你有没有决定你的网络服务只会被.NET

客户使用?


如果您希望能够利用XML Web Services提供的跨平台优势

,那么您应该停止考虑公开

类和DataSet和DataTable。相反,考虑暴露XML。


John


Joseph, have you decided that your web service will only be consumed by .NET
clients, ever?

If you want to be able to take advantage of the cross-platform benefits
offered by XML Web Services, then you should stop thinking about exposing
classes and DataSets and DataTables. Instead, think about exposing XML.

John


这篇关于通过Web服务返回数据集或数据表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆