473,242 Members | 1,808 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,242 software developers and data experts.

Web service serialization of return type

RJ
I've been trying to find documentation that explains limitation of possible
types that a webmethod can return. I realize xml serialization must take
place to return the specified type.

Must the return type of a webmethod implement ISerializable? I saw
something about using SoapInclude or XMLInclude attribute to include other
types in web services. Does this imply that it is possible to return any
type, even some third party class? I'm really interested in returning
something like a IBM.Data.DB2.DB2Connection object from a web method. I
tried this and I can compile the ws but whenever I try to reference it, I
get an exception ( Can't serialize Component.ISite )?

Nov 23 '05 #1
2 8773
"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
Nov 23 '05 #2
RJ
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

Nov 23 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: dgaucher | last post by:
Hi, I want to consume a Web Service that returns a choice, but my C++ client always receives the same returned type. On the other hand, when I am using a Java client, it is working fine (of...
0
by: psy000 | last post by:
Hi, I have a C# web service client that talks to a JAVA application sever. I use AXIS to generate the WSDL file, use wsdl.exe to generate proxy stub c# code. When I try to use c# client connect...
0
by: umhlali | last post by:
I get the following exception when my VB.NET app calls a Java web service that returns an array of objects. The same call works for a single object though. So looks like there is no problem...
8
by: Marc | last post by:
Hi! I'm calling a web service using C# and a wrapper class generated by wsdl tool. The web service specification contains some nillable parameters which types are Value Types in .NET (long, int,...
0
by: Peter Conrey | last post by:
I have a perl web service (using SOAP::Lite) with a method called "Detail" that returns a strucure (hash reference to be exact). It works fine when consumed by a Perl client, but when I try to...
3
by: Jerome Cohen | last post by:
AI am trying to call a third-party web service. this service expects an XML fragment that contains the request plus other parameter. adding the web reference created the syntax below(reference.vb)....
1
by: Vaibhav Modak | last post by:
Hi All, I have a Web Service written in Java (Web Logic) and I am trying to call it in my ASP. NET client. I am facing a problem while getting the data from the Web Service Method. My Web...
3
by: Olivier BESSON | last post by:
Hello, I have a web service of my own on a server (vb.net). I must declare it with SoapRpcMethod to be used with JAVA. This is a simple exemple method of my vb source : ...
3
by: Jeremy Chapman | last post by:
I've writtin a very simple web service in axis which returns an array of classes. I consume it in a .net app. When receiving the response, my .net app generates an error "Cannot assign object...
0
by: vpal61 | last post by:
Hello, I have an Excel/VBA web service client with SOAP Toolkit, consuming Apache Tomcat webservice, which is working fine. Now I am trying to migrate to .NET, and build client in VS2005 with...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.