Accessing Overloaded methods when Consuming an Object via a Web Reference

Discussion in 'ASP .Net Web Services' started by recoil@community.nospam, Apr 12, 2005.

  1. Guest

    When consuming a Web Service via a Web Reference I have a class that
    overrides the ToString method. The ToString then returns a custom
    friendly string representation of the object. This works fine when the
    control is consumed directly however when the object is consumed via a
    web reference in a project the overriden ToString method is not called.

    public class p
    {
    public override string ToString()
    {
    return "";
    }
    }

    If this object is added to a Combo Box directly the object shows "" as
    the text. If this is done via a Web Reference it shows Namespace.Type.

    Am I missing something.
     
    , Apr 12, 2005
    #1
    1. Advertising

  2. Brock Allen Guest

    > Am I missing something.

    Not to go on a tirade or anything, but web services aren't meant to be used
    this way. Web services are about sending XML messages across the network
    for interop purposes with other technology platforms (think java to .NET
    for example). Web Services are not about distributed objects. The reason
    many people get this incorrect impression is because the framework you're
    using to build web services (specifically .NET) hides to details and never
    explains the proper usage model. In short, the framework's too good at its
    job at hiding those details. You must approach the framework realizing that
    working with classes and objects is simply a convenience in your development
    environment. It's a convenience that abstracts the reality of XML, SOAP,
    XSD, WSDL and HTTP. So, use the framework, but realize that web services
    aren't classes and all the things you know and love about them.

    -Brock
    DevelopMentor
    http://staff.develop.com/ballen
     
    Brock Allen, Apr 12, 2005
    #2
    1. Advertising

  3. Guest

    Yeah. I sort of realized it a bit after I posted it. (Well I realized
    why it was not doing what I expected it to do).
     
    , Apr 13, 2005
    #3
    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. matt p
    Replies:
    3
    Views:
    494
    =?ISO-8859-15?Q?Juli=E1n?= Albo
    Nov 7, 2004
  2. __PPS__
    Replies:
    5
    Views:
    324
    __PPS__
    Jul 22, 2007
  3. john bailo

    Can web methods be overloaded ?

    john bailo, Oct 15, 2003, in forum: ASP .Net Web Services
    Replies:
    10
    Views:
    219
    Jim Blizzard [MSFT]
    Nov 27, 2003
  4. only_me

    vs2005 consuming web service, adding web reference ?

    only_me, Sep 20, 2005, in forum: ASP .Net Web Services
    Replies:
    2
    Views:
    216
    only_me
    Sep 25, 2005
  5. Anbu

    Consuming Web Service via WSDL Files

    Anbu, May 17, 2006, in forum: ASP .Net Web Services
    Replies:
    2
    Views:
    252
Loading...

Share This Page