2
Answers

wcf, return deserialized object

Murat Sozen

Murat Sozen

14y
7k
1



Hi Everyone,
I have a silverlight application wich executes a method on my wcf service. The method gets a xml file from my own webserver and deserializes the xml file to my object. The xml file is created using xmlspy. The xsd i created with xmlspy is used the generate my classes.
The problem is that when i call the function on the wcf service i get this error in my tracelog:

Er is een fout opgetreden tijdens de poging parameter http://tempuri.org/:ReadConfigResult te deserialiseren. Het InnerException-bericht is Type System.Xml.XmlNode[] met gegevenscontractnaam ArrayOfXmlNode:http://schemas.datacontract.org/2004/07/System.Xml wordt niet verwacht. Voeg typen die niet bekend zijn, op statische wijze aan de lijst met bekende typen toe, bijvoorbeeld door het KnownTypeAttribute-kenmerk te gebruiken of door ze aan de lijst met bekende typen toe te voegen die aan DataContractSerializer doorgegeven zijn.. Zie InnerException voor meer details.
---- english translation with google translate:

An error occurred while attempting to deserialiseren http://tempuri.org/:ReadConfigResult parameter. The Inner Exception message is System.Xml.XmlNode Type [] with data contract name ArrayOfXmlNode: http://schemas.datacontract.org/2004/07/System.Xml is not expected. Add types not known, static way to the list of known types, for example by using or KnownTypeAttribute attribute them to the list of known types to add that to his DataContractSerializer passed .. See Inner Exception for more details.

I get this error when the deserialized object is beïng returned to the client.
Does anyone have i idea what this could be? From the online msdn documentation i understood that some parts of the serialization could not be translated by wcf, when returning the result.

Answers (2)