Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Services > error using arraylist as webmethod argument

Reply
Thread Tools

error using arraylist as webmethod argument

 
 
Steven
Guest
Posts: n/a
 
      02-12-2006
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.Wr iteTypedPrimitive(String
name, String ns, Object o, Boolean xsiType)
Microsoft.Xml.Serialization.GeneratedAssembly.XmlS erializationWriter1.Write1_Object(String
n, String ns, Object o, Boolean isNullable, Boolean needType)
Microsoft.Xml.Serialization.GeneratedAssembly.XmlS erializationWriter1.Write3_getUpdateRecords(Object[]
p)

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



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Returning an ArrayList from a WebMethod() circuit_breaker@canada.com ASP .Net Web Services 4 01-17-2006 04:14 AM
a class inherited from ArrayList, is saved to ViewState, why the type of the object read from ViewSate is not the class, but the parent, ArrayList leal ting ASP .Net 1 02-10-2004 07:45 PM
Iterate through ArrayList using an another ArrayList Saravanan Rathinavelu ASP .Net 3 08-19-2003 07:03 AM
Returning ArrayList from WebMethod, best practices Alex ASP .Net Web Services 0 07-16-2003 12:58 AM
Problem returning ArrayList from WebMethod Alex ASP .Net Web Services 0 07-16-2003 12:51 AM



Advertisments