Interfaces And Web Services

J

Joe

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
 
M

Michael Pearson

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
 
S

Simon Smith

On Fri, 3 Oct 2003 13:41:56 -0400 in article
<#0#[email protected]> in
microsoft.public.dotnet.framework.aspnet.webservices , "Joe"
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
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.
 
E

Eirik M.

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,813
Latest member
lawrwtwinkle111

Latest Threads

Top