error using arraylist as webmethod argument

S

Steven

I'm having trouble using an arraylist of a custom object as an argument in a
webservice, everything is in VB.Net. Visual Studio

I can pass the custom object as an argument to other webmethods fine, and
can return it fine. I can have the webservice return an arraylist of the
objects and consume them with no dramas.

But whenever I call the method it gives this error, failing on the call,
before it actually goes 'into' the function.
"The type websync.Record was not expected. Use the XmlInclude or SoapInclude
attribute to specify types that are not known statically."

the WebMethod I'm calling looks like:
Public Function getUpdateRecords(ByVal type As String, ByVal records As
ArrayList) As ArrayList

The record looks like:
Public Class Record
Public id As New Integer
Public values As New ArrayList
End Class

This is part of the stack trace shown:
[InvalidOperationException: The type websync.Record was not expected. Use
the XmlInclude or SoapInclude attribute to specify types that are not known
statically.]
System.Xml.Serialization.XmlSerializationWriter.WriteTypedPrimitive(String
name, String ns, Object o, Boolean xsiType)
Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationWriter1.Write1_Object(String
n, String ns, Object o, Boolean isNullable, Boolean needType)
Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationWriter1.Write3_getUpdateRecords(Object[]
p)

Any help? I couldn't find any decent information on how to use
XMLinclude/SoapInclude that helped.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top