473,503 Members | 1,188 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

error using arraylist as webmethod argument

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.

Feb 12 '06 #1
0 3422

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
4103
by: Jose Fernandez | last post by:
Hello. I'm building a web service and I get this error. NEWS.News.CoverNews(string)': not all code paths return a value This is the WebMethod public SqlDataReader CoverNews(string Sport)...
2
8338
by: marat | last post by:
I have a managed c++ function below that makes a call to an unmanaged c++ dll .. This function is called from a C# app, resulting in a "Debug Assertion Failed dbgdel.cpp Line 52 Expression:...
3
8013
by: Frank H. | last post by:
Hi, in my webservice I have a Webmethod wich returns a list of Objects to my C++ Application. C# code: public class Contact { public string FirstName;
5
1617
by: John | last post by:
Hi Is it possible to pass a whole record to a webmethod? How? Thanks Regards
5
1390
by: Eveready | last post by:
I have a webservice that needs to return a paired list, such as created by an arraylist. The problem appears to be in serlizing the xml. Any help on how to return a paired list or arraylist would...
6
2776
by: Vinit | last post by:
Hi I am passing an arraylist to a c#/.net webmethod from a perl client using soap:lite. The trace shows the elements in the xml request. The arraylist input in the webmethod however does not...
5
4737
by: igotyourdotnet | last post by:
I'm creating a web service this is going to return an arraylist of items. When I try and run it Im' getting the following error message: System.InvalidOperationException: There was an error...
10
3687
by: pechar | last post by:
Hi all, I created a test web application in asp.net. It works like a dream in IE but when it gets to Firefox I get an exception as follows ...
0
7203
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7089
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7282
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7339
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6995
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7463
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5581
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
1515
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
389
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.