Re: How to return a user-defined data type object from a webservice?
- From: "John Saunders [MVP]" <john.saunders at trizetto.com>
- Date: Thu, 6 Mar 2008 10:49:36 -0500
"Bradley Plett" <plettb@xxxxxxxxxxxxxxxx> wrote in message
news:gl5vs319lq7ae3jrnnjdsm20unj0ps3q1j@xxxxxxxxxx
Yes, I understand that they're different classes and different
objects. That is, after all, the implication of different namespaces.
I also understand that there can be issues around the constructor and
any hidden data, but pragmatically the solution I suggested will
handle the majority of the situations common programmers deal with
between server-side and client-side objects. :-)
Sure, remoting might be a preferable solution to maintain the full,
true object, but sometimes remoting is overkill and I think sometimes
we tend to over-think/over-analyze and ignore simple solutions which
may be less elegant and less pure, but do the job.
Brad, in answering newsgroup and forum posts on this topic, I have found
many people who do expect the code they wrote in their server-side classes
to appear on the client side. In my opinion, that's because .NET makes it so
easy to call a "web method". After all, it's a _method_, isn't it?
The problem is that this totally obscures what's actually happening, so many
people never even learn that there is something different happening at all.
I recommend naming web references with the word "Proxy" in the name, so
that, maybe, some new developer will at least wonder "proxy for what"? It
would also make it easier for me, when they ask "where's my indexer", to
answer, "remember, it's only a proxy class". They could then say, "oh, so
_that's_ why it's called Proxy".
;-)
Also, Brad, if you're going to suggest that people modify the proxy class,
you should remind them that the class will be overwritten whenever "Update
Web Reference" is used. For that reason, I _never_ suggest modifying
generated code.
--
--------------------------------------------------------------------------------
John Saunders | MVP - Windows Server System - Connected System Developer
.
- Follow-Ups:
- Re: How to return a user-defined data type object from a webservice?
- From: Bradley Plett
- Re: How to return a user-defined data type object from a webservice?
- References:
- Re: How to return a user-defined data type object from a webservice?
- From: John Saunders [MVP]
- Re: How to return a user-defined data type object from a webservice?
- From: nano2k
- Re: How to return a user-defined data type object from a webservice?
- From: nano2k
- Re: How to return a user-defined data type object from a webservice?
- From: John Saunders [MVP]
- Re: How to return a user-defined data type object from a webservice?
- From: nano2k
- Re: How to return a user-defined data type object from a webservice?
- From: John Saunders [MVP]
- Re: How to return a user-defined data type object from a webservice?
- From: nano2k
- Re: How to return a user-defined data type object from a webservice?
- From: Bradley Plett
- Re: How to return a user-defined data type object from a webservice?
- From: John Saunders [MVP]
- Re: How to return a user-defined data type object from a webservice?
- From: Bradley Plett
- Re: How to return a user-defined data type object from a webservice?
- Prev by Date: Re: Webservice not returning the right datatype
- Next by Date: Re: Web Services Client Error
- Previous by thread: Re: How to return a user-defined data type object from a webservice?
- Next by thread: Re: How to return a user-defined data type object from a webservice?
- Index(es):
Relevant Pages
|