Groups | Blog | Home
all groups > dotnet web services > february 2005 >

dotnet web services : Error generating XML document - System.Object[] may not be used


RichardG
2/25/2005 2:01:02 AM
I have an object data class that Inherits from a java class and implements
System.Runtime.Serialization.ISerializable as I only need to transfer across
three properties, string, array of objects and another class OID, which
returns an integer.

I'm passing over the object data class to the web server, step through to
the client side proxy and get the following error, which I assume is a
problem before it even hits the web service directly.

There was an error generating the XML document."
"The type System.Object[] may not be used in this context."
StackTrace " at
System.Xml.Serialization.XmlSerializationWriter.WriteTypedPrimitive(String
name, String ns, Object o, Boolean xsiType)
at
Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationWriter1.Write3_Object(String n, String ns, Object o, Boolean isNullable, Boolean needType)
at
Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationWriter1.Write1_netObjectData(String
n, String ns, netObjectData o, Boolean isNullable, Boolean needType)
at
Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationWriter1.Write39_makePersistent(Object[] p)" String

It looks as though it's an issue with trying ot send over an array of
system.object.

Does anyone have any idea of what I can do to get this working
(binary/memory stream serialization seems an option).

Keenan Newton
2/25/2005 1:26:39 PM
Check out this MSDN URL on the valid types that may be passed via a web
service.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconaspnetimplementationofwebservices.asp

The "object" type is not allowed, however arrays are allowed.
RichardG
3/1/2005 2:23:05 AM
Many thanks. Missed that. I've changed over to use bytes for the more complex
AddThis Social Bookmark Button