473,386 Members | 1,791 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,386 software developers and data experts.

Circular References - Serializer/Deserializer

Hi folks,
I've been lately trying to expose an object graph (with circular
references) through a web method, however, this was not possible since
the XmlSerializer has got no idea how to address the issue. Therefore,
I've just changed the WebServiceBindingAttribute from

[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
to
[WebServiceBinding(ConformsTo = WsiProfiles.None)]

and added the SoapDocumentMethodAttribute to the web methods as
follows:

[SoapDocumentMethod(Use=SoapBindingUse.Encoded)]

The circular reference is solved auto-magically, however, the following
problem is introduced. Consider a class (MyEntity) that has got some
properties, say Prop1, Prop2 and Prop3 all of boolean type. On the
service side, consider this:

[WebMethod()]
[SoapDocumentMethod(Use=SoapBindingUse.Encoded)]
public MyEntity GetMyEntity()
{
MyEntity entity = new MyEntity();
entity.Prop1 = false;
entity.Prop2 = false;
entity.Prop3 = false;
return entity;
}

When the entity is marshaled to the client, the Prop2 value is true,
while it's being set to false!!!! What the heck is going wrong with
this? What happens when the type is serialized/deserialized??? Needless
to say that I've just simplified the MyEntity class to show you the
idea.

Any help would be highly appreciated,

Cheers,
Mehdi

Dec 11 '06 #1
0 1011

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

Similar topics

16
by: Kiuhnm | last post by:
Is there an elegant way to deal with semi-circular definitions? Semi-circular definition: A { B }; B { *A }; Circular reference: A { *B }; B { *A }; The problems arise when there are more...
2
by: Earth Worm Jim | last post by:
I have been able to get simple circular references to be serialized in xml by using the ImportTypeMapping method on the SoapReflectionImporter class. But I am unable to serialise circular...
8
by: Eric Eggermann | last post by:
I'm having a problem with really large file sizes when serializing the classes that describe my little document. There are some circular references which result in the same object getting written...
12
by: Frank Rizzo | last post by:
I have a circular reference between 2 classes in the same project (i.e. each class refers to the other). The app runs fine and I am seeing no issues, which kind of surprised me. Are there any...
5
by: Gos | last post by:
Hi, It is known that .NET does not allow us to add circular references. Is there a way to workaround this problem by late-binding the objects at run time? Will this create any other problems? ...
6
by: Stephen Robertson | last post by:
We are currently in a dead end with a circular reference issue using vb.net, and are hoping someone might help us resolve it. Idea... We have frmmain calling frmperson (dim f as new frmperson)...
0
by: David Levine | last post by:
I want to define a web method that returns an object that contains a member field that is an array of objects of the same type and another field that is the parent of the current object. The class...
2
by: Lapu-Lapu | last post by:
I have authored a web service using ASP 2.0. The web services return objects that use generics and that also contain circular references. Programmatically, everything works well, as long as you...
3
by: =?Utf-8?B?UGF1bCBIYWxl?= | last post by:
Moving all User Controls to a single directory has solved my problem - Thanks Eliyahu. That said, I still got one Circular ref error yesterday, rebuilt again and the build was fine? Far far...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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
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...

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.