DataTable不被svcutil接受-WCF服务 [英] DataTable not accepted by svcutil - WCF Service

查看:47
本文介绍了DataTable不被svcutil接受-WCF服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的"svcutil.exe"生成的WCF服务代理客户端有一个非常奇怪的问题.如果我没有返回DataTable的函数,则我的WCF服务将运行良好.一旦我添加了一个返回DataTable的方法,由svcutil.exe生成的客户端就会表现得很奇怪.不再找到该接口,客户端无法调用该服务.但是,如果我将其添加为服务参考,它的工作将非常顺利.我知道使用DataTable作为返回类型不是一个好习惯,但我需要这样做.我不能使用服务参考:-(不知道其行为或我所缺少的原因!!!

I'm having very strange issue with my WCF Service Proxy client generated by "svcutil.exe" . My WCF Service works very fine if I don't have a function that returns DataTable. As soon as I add a method that returns a DataTable the client generated by svcutil.exe is behaving very strangely. The Interface is no longer found and client is not able to call the service. But if I add as a Service Reference its working very smoothly. I know its not a good habit to use DataTable as a return type but I need to. I cannot use the Service Reference :-( Any idea why its behaving or what I'm missing!!!

推荐答案

看看 DataTableSurrogate 类.SyncFramework使用它进行序列化,并且真正易于使用. MSDN DataTableSurrogate

Have a look at the DataTableSurrogate class. It is used by the SyncFramework for serialization and really easy to use. MSDN DataTableSurrogate

这篇关于DataTable不被svcutil接受-WCF服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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