Re: How to return a user-defined data type object from a webservice?
- From: nano2k <adrian.rotaru@xxxxxxxxxxx>
- Date: Sat, 1 Mar 2008 22:44:42 -0800 (PST)
Thanks, John.
On 2 Mar, 03:07, "John Saunders [MVP]" <john.saunders at trizetto.com>
wrote:
"nano2k" <adrian.rot...@xxxxxxxxxxx> wrote in message
news:e44dea5c-53db-4e3a-b73f-fc0148296ca7@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi
In my solution I have 3 projects:
1. A class library. Let's name it CL (let's also name the namespace as...
"CL").
Where do I go wrong? How to "transport" more complex objects between
client and the webserver.
I understand how serialization works and I think the serialization
should implicitly work when returning such complex types. Maybe I
missed something.
Should I explicitly use soap serialization and deserialization? Hope
not.
You went wrong in not understanding web services. Web Services don't
"transport" complex types. They transport XML. In order to keep you from
having to deal with XML, .NET allows the service to "return" a complex type,
CL.Person. .NET then takes care of serializing that complex type into XML.
On the client side, in order to keep the client from having to deal with
XML, .NET creates proxy classes. In particular, it creates a
WebReferenceName.Person class. That is whtat the proxy GetPerson method
returns, not CL.Person.
So, long story short, your client should never reference the class library
"CL".
--
--------------------------------------------------------------------------------
John Saunders | MVP - Windows Server System - Connected System Developer
.
- Follow-Ups:
- 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?
- Prev by Date: Re: How to return a user-defined data type object from a webservice?
- Next by Date: Re: How to return a user-defined data type object from a webservice?
- 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
|
Loading