Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Web Services / April 2005

Tip: Looking for answers? Try searching our database.

Accessing Overloaded methods when Consuming an Object via a Web Reference

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
recoil@community.nospam - 12 Apr 2005 20:57 GMT
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.
Brock Allen - 12 Apr 2005 21:07 GMT
> 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
recoil@community.nospam - 13 Apr 2005 16:39 GMT
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).

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.