Click here to Skip to main content
15,063,944 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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,
Posted

1 solution

Although the problem desccription is not quite clear for me, I will suggest you have a look at this post http://geekswithblogs.net/SoftwareDoneRight/archive/2010/04/14/solving-ldquoxmlschemaexception-the-global-element-ltelementnamegt-has-already-been-declared.rdquo.aspx.

The guy seems to have some troubles due to the fact that he his using some WCF reserved words in his DataContract types name. For example, in the type ActivateSoftwareRequest (Request seems to cause problem). May be your Fii or Foo contains WCF reserved word.

Check for it.

Regards
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900