473,401 Members | 2,146 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,401 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 8782
"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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.