Serializing a derived class

Discussion in 'ASP .Net Web Services' started by deja@2bytes.co.uk, Sep 12, 2006.

  1. Guest

    hi,

    I have a web service that builds an arraylist of objects. These objects
    are derived classes of a base class with a few extra fields for help
    with processing. But when I return the objects I only want to return
    the base class implementation i.e

    public class ServiceObject : BaseObject
    {
    public string helper1;
    public string helper2;
    public string helper3;
    }

    When the arraylist is returned, I want the client to see a bunch of
    BaseObject objects NOT a bunch of ServiceObject objects. What is the
    easiest way of doing this? I thought I could probably use some
    serialization instructions but I'm not 100% sure on how to do it.

    thanks
    Phil
     
    , Sep 12, 2006
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Aidan Glendye

    Serializing classes derived from dataset

    Aidan Glendye, Jul 28, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    509
    Aidan Glendye
    Jul 28, 2003
  2. Replies:
    4
    Views:
    431
    Alf P. Steinbach
    May 23, 2007
  3. Replies:
    1
    Views:
    411
    myork
    May 23, 2007
  4. Replies:
    1
    Views:
    399
    Victor Bazarov
    May 23, 2007
  5. David
    Replies:
    3
    Views:
    414
    Grizlyk
    Jan 29, 2008
Loading...

Share This Page