Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Web Services / November 2004

Tip: Looking for answers? Try searching our database.

valid data type web method parameters???

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Will - 21 Nov 2004 03:29 GMT
I have a web method in my web service that I would to have a command object
passed in as a parameter. But when I compile the service I get the following
error:

You must implement the Add(System.Data.DataRowView) method on
System.Data.DataView because it inherits from ICollection.

If I replace the parameter's data type to a string, it compiles. Do web
services only allow certain data types to be passed to web methods?

Wll
Drew Marsh - 21 Nov 2004 19:54 GMT
> I have a web method in my web service that I would to have a command
> object passed in as a parameter. But when I compile the service I get
[quoted text clipped - 6 lines]
> web services only allow certain data types to be passed to web
> methods?

Yes, those types must be serializable according to the XmlSerializer classes rules. Specifically this rule is saying that because DataView is an ICollection subtype, in order for the XmlSerializer to be able to add child elements to this collection, DataView needs to support an Add method. Obviously it does not and since you don't own the class there's not really any way to ever add it.

DataSet is really the only System.Data class specifically designed to be aware of serializing itself. That said, you might want to skim the newsgroups for recent discussions about the pitfalls of using them.

HTH,
Drew

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.