What should be returned from web service instead o

2019-06-10 02:50发布

问题:

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?

Thanks.

回答1:

I would create a serializable class that can represent each record in the data set and then return a collection of that.



回答2:

Use a cross-platform dataformat like XML or JSON that both worlds (PHP & C#) understand.