应该从 Web 服务而不是数据表返回什么? [英] What should be returned from web service instead of datatable?
问题描述
我创建了一个 Web 服务,我需要在其中从一个函数返回多个记录.为此,我使用了数据表,但发现它无法序列化.所以我们不能使用它.所以我使用数据集而不是数据表.我的服务将在 PHP 中使用.我不确定他们(PHP 开发人员)是否能够从我的数据集(从我的网络服务函数返回)中获取数据.
I have created a web service in which i need to return multiple records from a function. For that I used datatable, but found that as it cannot be serialized. So we can't use it. So I used dataset instead of datatable. My service is going to be used in PHP. I am not sure that they (PHP developers) will be able to get data from my dataset (returned from my webservice's function) or not.
请建议我应该返回什么.数据集还是有其他更好的选择?
Please suggest me what I should return. Dataset or is there any other better option available?
谢谢.
推荐答案
我会创建一个可序列化的类,它可以表示数据集中的每条记录,然后返回它的集合.
I would create a serializable class that can represent each record in the data set and then return a collection of that.
这篇关于应该从 Web 服务而不是数据表返回什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!