Re: How to return a user-defined data type object from a webservice?



"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


.



Relevant Pages

  • Re: how can i convert .asmx file to a .ashx?
    ... wsewsdl2.exe is a tool that generates proxy code for Web service clients ... The proxy derived from ... When you build an XML Web service client, whether you use Visual Studio .NET ... a proxy class is generated to communicate with the XML Web service. ...
    (microsoft.public.dotnet.framework.webservices.enhancements)
  • Re: WebService Proxy Classes (using wsdl.exe) ! Need expert help ! MS PEOPLE ?
    ... consuming) was to write a VS AddIn app to manipulate my proxy files ... > I don't use the webservices by adding a WebReference, ... > But since I've generated my Proxy classes through wsdl.exe, ... OR 2) re-generate the proxy class. ...
    (microsoft.public.dotnet.languages.csharp)
  • RE: Soap Response
    ... Try refreshing the proxy. ... Thread-Topic: Soap Response ... webservice as per the following code in the proxy class: ... Public Function process3ParmRequest(ByVal inputHeader As String, ...
    (microsoft.public.dotnet.framework.webservices)
  • Re: Web reference/Proxy class problems with custom objects
    ... my custom type s generated from the XSD and my web proxy doesn't expose the System.Xml.Serialization.XmlRootAttribute from the XSD. ... When I serialize from the proxy class, ...
    (microsoft.public.dotnet.framework.aspnet.webservices)
  • RE: How to pass an object as parameter ?
    ... If it is your intent to have the same implementation shared by the client ... The generated proxy has a "data compabible" implementation of the classes ... your server side data DLL. ... >name of the object in the proxy class. ...
    (microsoft.public.dotnet.framework.aspnet.webservices)