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



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


.



Relevant Pages

  • 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. ... The paradigm of Web Services is all about interoperability between client ... Web Services standards. ...
    (microsoft.public.dotnet.framework.webservices)
  • RE: Mobile 2 Server: WCF or asmx
    ... We use WCF extensively on a Warehouse Management System we built ... devices and the Server. ... Frankly, I was hoping that the MsmqBinding would be available on the mobile, ... GUI app communicating with a server with web services. ...
    (microsoft.public.dotnet.framework.compactframework)
  • Re: Mobile 2 Server: WCF or asmx
    ... WCF offers more possibilities, but perhaps that the CF 2.0 will be ... We are in the process of developing a Windows Mobile 5 app. ... GUI app communicating with a server with web services. ...
    (microsoft.public.dotnet.framework.compactframework)
  • Re: Remoting & Security
    ... Consider a switch to web services and using WSE or use SCF. ... It is a bit of a pain to have your software auto-respond, however, and the main reason why Remoting is not worth the pain. ... Once you get to WCF, Remoting becomes far easier, but then in 3.0 it looks a lot like a web service in 1.x/2.0 - WCF gives choices). ... I know I can use the IpcChannel to restrict access to the local machine, but I'd like to be able to control who accesses the server but still have the server publicly visible via HttpChannel or TcpChannel. ...
    (microsoft.public.dotnet.framework)
  • Re: Windows Authentication, Single sign on and Active Directory
    ... your web server is probably a workgroup mode machine. ... Co-author of "The .NET Developer's Guide to Directory Services ... web service proxy client fails to connect due to authentication failure ... Windows authentication on the web services. ...
    (microsoft.public.dotnet.framework.aspnet.security)