473,465 Members | 1,773 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

web service serialisation

5 New Member
hi all,
hope you can help.
im writing some webservice to retireve data from a db(sql server)
ive create some objects to encapsulate the data.
the classes have been set as serializable.
from my webservice, i can get a single object or a collection of objects back.
the problem i am having is that the service wont return back collections of object within a class.

e.g

class item
property a
property b
end class

class items

property name

property items as item()

end class

in such a scenario where the items class contains a collection of item, i only get back the property name for example but not the collection.

they are all declared as public
i tried the items with readonly and read/write.
any pointer would be greatly appreciated.

many thanks in advance.
Feb 5 '08 #1
3 892
RedSon
5,000 Recognized Expert Expert
hi all,
hope you can help.
im writing some webservice to retireve data from a db(sql server)
ive create some objects to encapsulate the data.
the classes have been set as serializable.
from my webservice, i can get a single object or a collection of objects back.
the problem i am having is that the service wont return back collections of object within a class.

e.g

class item
property a
property b
end class

class items

property name

property items as item()

end class

in such a scenario where the items class contains a collection of item, i only get back the property name for example but not the collection.

they are all declared as public
i tried the items with readonly and read/write.
any pointer would be greatly appreciated.

many thanks in advance.
I don't understand your example, or why serialization has anything to do with it. If your method returns a collection of objects withing some kind of collection class why can you not access those multiple objects?
Feb 6 '08 #2
azadur
5 New Member
I don't understand your example, or why serialization has anything to do with it. If your method returns a collection of objects withing some kind of collection class why can you not access those multiple objects?
sorry, i was trying to keep it short.
class1 has some public properties
class2 inherits collectionbase. it has 2 public methods, add, remove to keep a collection of class1 objects

i have a class3 which has come properties. it also has a property which is class2.
when i return class3 from the ws, it only serialises the public properties in class3. it does ode serialise the collection of class2 objects
i.e


public property items as class2

it is a serialisation problem, because i am looking for deep serialisation.

so:

class1
public name

class2:collectionbase
public add(o as class1)

class3
public value
public items as class2


my ws returns

<value/>
<value/>


i would like(assume 1 object in the items)

<value/>
<items>
<name />
<items>
<value/>
Feb 6 '08 #3
RedSon
5,000 Recognized Expert Expert
sorry, i was trying to keep it short.
class1 has some public properties
class2 inherits collectionbase. it has 2 public methods, add, remove to keep a collection of class1 objects

i have a class3 which has come properties. it also has a property which is class2.
when i return class3 from the ws, it only serialises the public properties in class3. it does ode serialise the collection of class2 objects
i.e


public property items as class2

it is a serialisation problem, because i am looking for deep serialisation.

so:

class1
public name

class2:collectionbase
public add(o as class1)

class3
public value
public items as class2


my ws returns

<value/>
<value/>


i would like(assume 1 object in the items)

<value/>
<items>
<name />
<items>
<value/>
Maybe you should post some code because I still have no idea what you are talking about.
Feb 6 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

12
by: Noel | last post by:
Hello, I'm currently developing a web service that retrieves data from an employee table. I would like to send and retrieve a custom employee class to/from the webservice. I have currently coded...
2
by: Greg | last post by:
I have a bizarre situation in which serialisation is failing routinely under a specific condition, and I'm wondering if the details ring a bell with anyone here. I have 2 classes that my...
2
by: ashwinij | last post by:
Hello The steps which i am doing in my program 1) I am having an xml file. 2) I am performing some updations in the file using XQueryUtil class from nux package. 3)After that i am...
1
by: OrionLee | last post by:
I am using C# to work with a 3rd party DLL (Nevron Charts), and attempting to serialise it. The serialisation itself is handled somewhere inside the DLL, so to get it to happen you call the Nevron's...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.