将字节数组从服务传递到客户端时的 WCF NetDispatcherFaultExcption
我正在尝试将文件(字节数组)从服务传递到客户端。我收到“格式化程序在尝试反序列化预期状态‘元素’时抛出异常。遇到名称为‘’、命名空间‘’的‘文本’”错误。任何有关如何修复它的想法将不胜感激。
谢谢,
拉贾
I am trying to pass a file (byte array) from the service to the client. I receive "the formatter threw an exception while trying to deserialize Expecting state 'Element'.. Encountered 'Text' with name '', namespace ''" error. Any ideas on how to fix it will be much appreciated.
Thanks,
Raja
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在我花了四个小时的时间后,我找到了问题的答案。罪魁祸首就是WSSF(Web服务软件工厂)。在生成数据契约时,它已将其生成为文件列表而不是字节[]。在我的代理中将列表更改为 byte[],现在一切正常。希望这对某人有帮助。
谢谢,
拉贾
After breaking my head for 4 freaking hours I found the answer to the problem. It is the WSSF(Web service software factory) who is the culprit. While generating the data contract it had generated it as List for file instead of byte[]. Changed the List to byte[] in my proxy and everything works well now. Hope this helps someone.
Thanks,
Raja