Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Error returning arraylist of objects
Message
 
À
17/09/2003 11:58:14
Gary Otte
California Youth Authority
Sacramento, Californie, États-Unis
Information générale
Forum:
ASP.NET
Catégorie:
Web Services
Divers
Thread ID:
00829938
Message ID:
00830127
Vues:
17
Hi Gary,

To add more to what Bonnie already said, try the info in this link to see if it takes care of the problem. You need to convert the ArrayList to XML:

http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&selm=ebmZgcL8AHA.1384%40tkmsftngp04


>I have defined a class called "Employee" in my web service that contains 3 instance variables: lastname, firstname and ssn. I have a web method that creates an arraylist of Employee objects. Stepping thru the debugger shows that the arraylist does indeed contain Employee objects as expected.
>
>However, returning this arraylist from the web method produces the following error:
>
>System.InvalidOperationException: There was an error generating the XML document. ---> System.InvalidOperationException: The type wsEmployee.EmpServices+Employee was not expected. Use the XmlInclude or SoapInclude attribute to specify types that are not known statically.
>
>Reading the docs on XMLIncludeAttribute and SOAPIncludeAttribute just left me scratching my head.
>
>Thanks in advance for any comments to help solve this.
>
>Gary
-----------------------------------------

Cathi Gero, CPA
Prenia Software & Consulting Services
Microsoft C# / .NET MVP
Mere Mortals for .NET MVP
cgero@prenia.com
www.prenia.com
Weblog: blogs.prenia.com/cathi
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform