473,657 Members | 2,540 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 getUpdateRecord s(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:
[InvalidOperatio nException: The type websync.Record was not expected. Use
the XmlInclude or SoapInclude attribute to specify types that are not known
statically.]
System.Xml.Seri alization.XmlSe rializationWrit er.WriteTypedPr imitive(String
name, String ns, Object o, Boolean xsiType)
Microsoft.Xml.S erialization.Ge neratedAssembly .XmlSerializati onWriter1.Write 1_Object(String
n, String ns, Object o, Boolean isNullable, Boolean needType)
Microsoft.Xml.S erialization.Ge neratedAssembly .XmlSerializati onWriter1.Write 3_getUpdateReco rds(Object[]
p)

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

Feb 12 '06 #1
0 3431

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

Similar topics

12
4119
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
8378
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: _BLOCK_TYPE_IS_VALID(pHead->nBlockUse)" errir message. This happens on function exit, looks like related to destruction of some vector. Any ideas why ????
3
8023
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
1630
by: John | last post by:
Hi Is it possible to pass a whole record to a webmethod? How? Thanks Regards
5
1401
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 be gratly appreciated. ***********code <WebMethod()> _ Public Function getMyData() As ArrayList Dim lvSqlString = "SELECT * FROM PRODUCTS" Dim myData As New ArrayList
6
2794
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 contain any values and is empty. It works fine with arrays....but NOT arraylists....does anyone know WHY? and HOW TO SOLVE THIS ISSUE? Regards,
5
4749
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 generating the XML document. ---System.InvalidOperationException: The type Car List was not expected. Use the XmlInclude or SoapInclude attribute to specify types that are not known statically. at...
10
3702
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 ----------------------------------------------------------------------------------------- "System.ArgumentException: Invalid postback or callback argument. Event validation is enabled using <pages enableEventValidation="true"/> in configuration or <%@ Page EnableEventValidation="true" %> in a page."...
0
8425
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8326
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8743
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8522
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7355
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6177
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5647
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
2
1973
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1736
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.