将字节数组从服务传递到客户端时的 WCF NetDispatcherFaultExcption

发布于 2024-09-26 05:22:27 字数 125 浏览 0 评论 0原文

我正在尝试将文件(字节数组)从服务传递到客户端。我收到“格式化程序在尝试反序列化预期状态‘元素’时抛出异常。遇到名称为‘’、命名空间‘’的‘文本’”错误。任何有关如何修复它的想法将不胜感激。

谢谢,

拉贾

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

梦初启 2024-10-03 05:22:27

在我花了四个小时的时间后,我找到了问题的答案。罪魁祸首就是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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文