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.
Loading
Juncheng ZhangPosted Apr 7, 2010, 1:55 PM
Hi, Murat,
I am glad you got your appliation working. I am currently working on a silverLight application with wcf service, I tried to create a silverLight web application, and I try to call an wcf data service which returns a Dictionary data when it receive request with a table name and where clause.
Dictionary<string, string> IDataService.getTableData(string tableName, string whereClause)
{
Dictionary<string, string> d = new Dictionary<string, string>();
//sql codes are not problem for me but I don't know how to config to work in this way
.....
returen d;
}
These two projects are separate, but they are in the same machine hosted unser IIS. the url may be in a form like
http://MachineName/ProjectName/serviceName.svc // or anything similar
and should be able to receive the request from remote machine. How can I do this? Can you help out? Thank you in advance.
Dave
Murat SozenPosted Feb 18, 2010, 4:10 PM
----- Update:
Got it working. The problem was that i had a element with a undefined datatype.