Interfaces And Web Services

Discussion in 'ASP .Net Web Services' started by Joe, Oct 3, 2003.

  1. Joe

    Joe Guest

    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
     
    Joe, Oct 3, 2003
    #1
    1. Advertisements

  2. 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
     
    Michael Pearson, Oct 3, 2003
    #2
    1. Advertisements

  3. Joe

    Simon Smith Guest

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

    Eirik M. Guest

    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
     
    Eirik M., Oct 5, 2003
    #4
  5. Joe

    Joe Guest

    Thanks to all.
    Joe
     
    Joe, Oct 6, 2003
    #5
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.