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 / October 2003

Tip: Looking for answers? Try searching our database.

Interfaces And Web Services

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Joe - 03 Oct 2003 18:41 GMT
Hi,

Im having a little trouble with the fiollowing in a web service

Public Interface IBookAttribute
  Property Description() As String
End Interface

I get "Cannot serialize Inteface MyApp.IBookAttribute"

Is it possible to do so, or are interfaces not a good idea for web services
(why not?)?

Thanks
Joe
Michael Pearson - 03 Oct 2003 22:01 GMT
I think it's because you don't impliment ISerializable.  The webservice
doesn't know how to "translaste" your interface into XML.  Do some research
on ISerializable and webservices.

Michael

> Hi,
>
[quoted text clipped - 11 lines]
> Thanks
> Joe
Simon Smith - 04 Oct 2003 10:26 GMT
On Fri, 3 Oct 2003 13:41:56 -0400 in article
<#0#FrWdiDHA.3104@tk2msftngp13.phx.gbl> in
microsoft.public.dotnet.framework.aspnet.webservices , "Joe"
<x@hotmail.com> wrote:

>Hi,
>
[quoted text clipped - 11 lines]
>Thanks
>Joe

I think that interfaces are almost by definition not serialisable. To
be serialisable a class must provide a default constructor - one with
no parameters: interfaces don't have and can't have constructors.

Signature

Simon
simon dot smith at snowvalley dot com
"Insomnia is a small price to pay for the stuff you read on UseNet"

Eirik M. - 05 Oct 2003 20:11 GMT
Search MSDN for an article about how to use interfaces and web-services.
Haven't got the link handy, but the articles is out there somewhere :-)

Eirik M

> On Fri, 3 Oct 2003 13:41:56 -0400 in article
> <#0#FrWdiDHA.3104@tk2msftngp13.phx.gbl> in
[quoted text clipped - 20 lines]
> be serialisable a class must provide a default constructor - one with
> no parameters: interfaces don't have and can't have constructors.
Joe - 06 Oct 2003 14:03 GMT
Thanks to all.
Joe

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



©2009 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.