Mickey,
Thanks for the info. My real goal is to construct a connection pooling
gateway component that will reside on a server. This component would accept
requests from many clients, and manage a limited number of DB2 connections
to a mainframe. The DB2Connection object is a managed assembly from IBM,
which works like the .NET SQLClient.Data.Connection class. A web service is
the first technology I looked at, not knowing if it will work or not, with
remoting the next option.
At the conceptual level, it doesn't seem so crazy. If it is impossible to
implement, with no available mechanism to marshall a "usable" connection
object between computers- then yes it's not useful - that's what I'm trying
to understand.
The hope is that a client would receive the object, typecast it back to a
DB2Connection if needed, then be able to call DB2DataReader.ExecuteReader.
Yes, I'm hoping the reader would read from the mainframe, not the server.
If there is a way in .NET, via serialization or marshalling, that an object
of this nature, which obviously contains IP specific details, can be passed
between computers, I'm trying to understand what it is. Thanks for
clarification.
RJ
"Mickey Williams [C# MVP]" <my first name at servergeek dot com> wrote in
message news:%2****************@TK2MSFTNGP10.phx.gbl...
"RJ" <RJ@PostOnly.com> wrote in message
news:ut**************@TK2MSFTNGP15.phx.gbl...
Must the return type of a webmethod implement ISerializable?
No.
I saw
something about using SoapInclude or XMLInclude attribute to include
other types in web services.
This is required when you have polymorphic behavior in serialized types.
Does this imply that it is possible to return any
type, even some third party class?
Any type that can be XML serialized. Remember that XML serialization is
not full-fidelity, and only public fields and properties will be serialized.
I'm really interested in returning
something like a IBM.Data.DB2.DB2Connection object from a web method.
That would be an incredibally bad idea if it were possible. Which it
isn't. Leaving aside the obvious secuirty and scalability problems, what would a
copy of the connection look like? How would a client program that received
the serialized connection use it remotely?
--
Mickey Williams
Author, "Visual C# .NET Core Ref", MS Press
www.neudesic.com
www.servergeek.com