"Max André Bündchen" <Ma************ @discussions.mi crosoft.comwrot e in
message news:77******** *************** ***********@mic rosoft.com...
When a web method return a custom class, like a Employee definition, the
proxy definition in the client recriate the definition of Employee using
the
public fields/properties of the original class.
In this process all custom methods of the Employee definition was lost in
the client.
My question is: if server and client are developed in .Net 2.0 there's a
way
to create a Employee object in one side and take the full object in the
other
side of the web method, using the same Employee assembly in both sides?
Take off the option of instanciating a Employee object and hardcode the
migrations of the fields from proxy class to biz class.
Web services do not pass objects around. They pass XML, which is
deserialized into an object of a different class than the one which was
serialzed into the XML that was passed.
If you want to pass objects, and not XML, then you should look into .NET
Remoting.
Consider: if you returned your Employee object as the return from a Web
Service, then how would a scripting language like Perl or JavaScript call
the methods of that object? How would a non object-oriented langage even
know what the methods were?
This is all a part of the platform-independance that makes Web Services so
powerful.
And, if you really need the full semantics of .NET objects, then you need
..NET remoting, which also supports SOAP over HTTP.
John