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



On 5 Mar, 00:46, "John Saunders [MVP]" <john.saunders at trizetto.com>
wrote:
"nano2k" <adrian.rot...@xxxxxxxxxxx> wrote in message

news:35fd1af1-4792-47a3-a0af-a03f77292227@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

On 3 Mar, 14:34, "John Saunders [MVP]" <john.saunders at trizetto.com>
wrote:

"nano2k" <adrian.rot...@xxxxxxxxxxx> wrote in message

news:e6603399-aff7-4e0e-b6aa-d66db798e4b6@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Anyway,

Passing DataSet or XmlNode objects works by itself.
How can I enable my Person class to act like the above ones?

=========
You don't want to. Really.
--
---------------------------------------------------------------------------­­-----
John Saunders | MVP - Windows Server System - Connected System Developer

Sorry, but why?
Just for the record.
=
I pretty much told you why before. It's just not how Web Services works.

The paradigm of Web Services is all about interoperability between client
and server by using industry-standard protocols (HTTP) and data formats
(XML). You are asking how you can use the above to pass data specific to a
particular platform (Microsoft .NET). There is no provision for that in the
Web Services standards. If you read those standards, you'll find mention of
the use of standards (XML Schema) to describe the structure of the data to
be exchanged. Nowhere in any of those standards is there an ability for you
to specify a particular data type from a particular platform.

This is in contrast to .NET Remoting, which is platform-specific, and which
actually transmits the full typename and assembly name of the types of the
data being transferred. This permits the client to receive instances of the
precise type sent by the server. There is no provision for anything like
this in Web Services.

Now, I'm only just recently getting up to speed on WCF, but it looks like
when you create a Service Reference (the WCF equivalent of a Web Reference),
you have the ability to tell WCF to try to reuse datatypes if the types are
declared in particular assemblies. This may give you what you're looking
for, as long as you are in a controlled environment where you can be certain
that the type that WCF will choose for you is compatible with the type being
sent by the server. An example of such an environment is when the server and
all of its clients are in the same .NET solution. Tihs may be acceptable for
"internal" web services, which are only ever meant to be used by well-known
clients. It cannot work in the general case.
--
---------------------------------------------------------------------------­-----
John Saunders | MVP - Windows Server System - Connected System Developer

Thanks John.
I understand and aggree entirely.
But my app is ment to work ONLY on .NET platforms. It is not a public
web site or smtg like that.
It's an "internal" application for a company that will use the app
inside its own VPN.
More than that, I'm being asked to secure the entire system so that
the webservice will only work with the designated client (also
developed by me).

So I find myself in this particular case, not in the general case. I
assure you I understand how interoperatibility works and its demands.

Anyway, your input was very good for me, but what do you say about my
particular situation? Creating standard XML schemas for each type I
want to "transport" would be a waiste of time, as I am 100% SURE my
webservice will only be accessible from a .NET client.

PS: I should have been more specific on this on my first post, my bad.
.



Relevant Pages

  • Re: How to return a user-defined data type object from a webservice?
    ... your client ... object coming from the server via the web service is in a different ... John Saunders | MVP - Windows Server System - Connected System Developer ... It's just not how Web Services works. ...
    (microsoft.public.dotnet.framework.webservices)
  • Re: Windows Authentication, Single sign on and Active Directory
    ... web service proxy client fails to connect due to authentication failure ... the web services anyway, as it is generally important to protect any ... web server is also a member of the domain). ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: How to return a user-defined data type object from a webservice?
    ... John Saunders | MVP - Windows Server System - Connected System Developer ... It's just not how Web Services works. ... Web Services standards. ... when you create a Service Reference (the WCF equivalent of a Web Reference), ...
    (microsoft.public.dotnet.framework.webservices)
  • Re: Windows Authentication, Single sign on and Active Directory
    ... The server is always in the domain. ... On a client machine, if I am ... Your web services can then determine the identity of the authenticated ... Co-author of "The .NET Developer's Guide to Directory Services ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: Communications between different .NET Applications
    ... large chunk of data around use .net remoting. ... bit harder to setup and get running than web services but it better ... Web services you will essentially have the clients talking to the server ... > My desire is to have client versions of my application running on a couple ...
    (microsoft.public.dotnet.languages.csharp)