Issue while returning Dataset through WCF Service

我的未来我决定 提交于 2019-12-22 08:40:00

问题


I have been facing a strange problem while returning dataset through WCF service (WSHttpBinding). I'm explaining the senario below:

  1. I have a Businesslayer, inside is a folder 'Demo', which contains a class file demo.cs, which carries the variable for a particular table.

  2. Next, i have a Datalayer, inside is a folder 'Demo', also contains a class file demo.cs, which contains all the database related functions and methods.

  3. Next, I have created a WCF service, which contains a interface (Idemo.cs), which is [ServiceContract] defined and all the signatures for the methods are defined, using 'OperationContract'.

  4. In the WCFService.cs class, i have all the methods which have to be called from GUI.

  5. Lastly, i created the proxy for the service in the Application using 'svcutil'.

The ISSUE/PROBLEM :

All the other services return list object, which are working perfectly, but in demo case, it return dataset. In dataset case, the service created(in appCode) is very different from the other list returning classes. All the other service are called using strucure like 'Businesslayer.demo.demolist objdemo' but in this case this structure shows an error and excepts structure 'demo objdemo'

I dont now, whether i m able to explain my concern, but it will be very helpful if anyone can send me the demo application with same senario, returning dataset through WCF service.


回答1:


  1. Do not return a DataSet from a service operation.

To see why: http://www.hanselman.com/blog/ReturningDataSetsFromWebServicesIsTheSpawnOfSatanAndRepresentsAllThatIsTrulyEvilInTheWorld.aspx



来源:https://stackoverflow.com/questions/9207233/issue-while-returning-dataset-through-wcf-service

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!