M
mehdi
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
and the problem is solved.
[SoapDocumentMethod(Use=SoapBindingUse.Encoded)]
The questions:
1. I would like to know this means that I only and only lose the
interoperability? Is this what happens???
2. Is there anyway to solve the circular referencing problem within the
object graph when exposing objects through web methods under the WSI
Basic Profile 1.1 standard?
3. Consider a class (MyEntity) that has got some properties, say Prop1,
Prop2 and Prop3 all of boolean type. On the service side, consider
this:
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 is true, while
it's being set to false!!!! What the heck is going wrong with this?
TIA,
Mehdi
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
and the problem is solved.
[SoapDocumentMethod(Use=SoapBindingUse.Encoded)]
The questions:
1. I would like to know this means that I only and only lose the
interoperability? Is this what happens???
2. Is there anyway to solve the circular referencing problem within the
object graph when exposing objects through web methods under the WSI
Basic Profile 1.1 standard?
3. Consider a class (MyEntity) that has got some properties, say Prop1,
Prop2 and Prop3 all of boolean type. On the service side, consider
this:
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 is true, while
it's being set to false!!!! What the heck is going wrong with this?
TIA,
Mehdi