本文介绍了动态wcf客户端代理和调用方法返回类型不匹配的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 当我使用wcf从生成代理客户端调用方法时出现问题。 问题是服务合同中定义的方法返回的类型与类中定义的类型不同。 [DataContract(Name = Foo)] 公共类Fii {} 和方法返回的类型是Foo但我不知道如何在不改变DataContract属性的情况下将Foo类型解析为Fii类型。 i使用了knowntype和knownServiceType但没有。 (我得到一个带有wsdl链接的uri,我通过代码生成代理并且一切正常) 任何人都可以帮助我吗? 谢谢,解决方案 Hi,I have a problem when i call a method from a generate proxy client with wcf.The problem is that the returned type from the method defined in the service contract is different that type the defined in a class.[DataContract(Name="Foo")]public class Fii{}and the type returned by the method is Foo but i don''t known how to resolve the Foo type to Fii type without changing the DataContract attribute.i have used the knowntype and knownServiceType but nothing.(i get a uri with a wsdl link and i do all by code to generate the proxy and all is ok)Can anyone help me?Thanks, 解决方案 这篇关于动态wcf客户端代理和调用方法返回类型不匹配的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!