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



"nano2k" <adrian.rotaru@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


.



Relevant Pages

  • Re: DataSet and serialization is dangerous
    ... I myself don't think XML serialization really has a problem. ... are only two choices when a diffgram is in this state, ... >> perl client, etc. ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: How to return a user-defined data type object from a webservice?
    ... client and the webserver. ... I understand how serialization works and I think the serialization ... should implicitly work when returning such complex types. ... They transport XML. ...
    (microsoft.public.dotnet.framework.webservices)
  • Re: How to return a user-defined data type object from a webservice?
    ... client and the webserver. ... I understand how serialization works and I think the serialization ... should implicitly work when returning such complex types. ... They transport XML. ...
    (microsoft.public.dotnet.framework.webservices)
  • Re: how to export view to display - xml with specific xsd?
    ... Also xp_cmdshell runs on the server, ... SQL Server to a file and open the file in Word on the client machine. ... It opens up a ... XML to be generated in a Word-specific XML format. ...
    (microsoft.public.sqlserver.xml)
  • RE: WebService returns a custom object
    ... There are many many attributes that control serialization. ... WebService returns a custom object ... WS can expose only the following types as ... > service infrastructure or any commercial tools will provide a client side ...
    (microsoft.public.dotnet.framework.webservices)

Loading