can webmethods be polymorphic?

Discussion in 'ASP .Net' started by Manco, Feb 3, 2005.

  1. Manco

    Manco Guest

    Let's say I have a web-service that defines Web method:

    void DoSomething(BaseType b);

    let's day I have a DerivedType: BaseType. Can a web-service automatically
    take a derived object base reference like a normal C# method would do? So
    far I haven't been able to.
     
    Manco, Feb 3, 2005
    #1
    1. Advertising

  2. Manco

    Lionel LASKE Guest

    My guess is yes.
    You can use a DerivedType where a BaseType is expected.
    It's just an XML problem. When .NET Framework serialize your DerivedType, it
    take all fields and save them in XML. Fields from BaseType are saved then
    fields from DerivedType are saved.
    XML had been done to let updating of schema without impacting existing app.
    So, when the .NET Framework deserialize your DerivedType as a BaseType, it
    will take in the XML the fields needs for BaseType and ignore others (those
    from DerivedType).


    Lionel.


    "Manco" <> a écrit dans le message de news:
    9fgMd.1488$wc.414@trnddc07...
    > Let's say I have a web-service that defines Web method:
    >
    > void DoSomething(BaseType b);
    >
    > let's day I have a DerivedType: BaseType. Can a web-service automatically
    > take a derived object base reference like a normal C# method would do? So
    > far I haven't been able to.
    >
     
    Lionel LASKE, Feb 3, 2005
    #2
    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. mdh
    Replies:
    0
    Views:
    947
  2. godwin
    Replies:
    0
    Views:
    443
    godwin
    Apr 15, 2005
  3. GMHK

    WebMethods Info

    GMHK, Jun 10, 2005, in forum: Java
    Replies:
    0
    Views:
    397
  4. shovavnik

    selectively exposing webmethods

    shovavnik, Aug 3, 2003, in forum: ASP .Net Web Services
    Replies:
    1
    Views:
    138
    Marina
    Aug 4, 2003
  5. Jimmy
    Replies:
    0
    Views:
    116
    Jimmy
    Aug 31, 2004
Loading...

Share This Page