472,354 Members | 1,340 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

Attribute missing / not serialized


I have a WS client. All the code is generated by VS.NET 2003.

For me its seems that an attribute is not generated during sending the
request in the SOAPHeader.
The problem is with RFCSendingValue.
There the attribute 'groupeid0 isn't generated in the SOAP request.
The proxy is generated this way:

/// <remarks/>

public RFCSending RFCSendingValue;
public EFCSending EFCSendingValue;
[System.Web.Services.Protocols.SoapHeaderAttribute( "RFCSendingValue",
Direction=System.Web.Services.Protocols.SoapHeader Direction.In,

[System.Web.Services.Protocols.SoapHeaderAttribute( "EFCSendingValue",
Direction=System.Web.Services.Protocols.SoapHeader Direction.Out,

[System.Web.Services.Protocols.SoapDocumentMethodAt tribute("",
Use=System.Web.Services.Description.SoapBindingUse .Literal,
ParameterStyle=System.Web.Services.Protocols.SoapP arameterStyle.Bare)]

[return: System.Xml.Serialization.XmlArrayAttribute("EFCCas e",

[return: System.Xml.Serialization.XmlArrayItemAttribute("ca rdIndex",
Namespace=http://www., IsNullable=false)]

public EFCCaseTypeCardIndex[]
identifyClient([System.Xml.Serialization.XmlArrayAttribute(Namespa ce=http://
www.)] [System.Xml.Serialization.XmlArrayItemAttribute("ca rdIndex",
Namespace=http://www., IsNullable=false)] RFCCaseTypeCardIndex[] RFCCase) {

object[] results = this.Invoke("identifyClient", new object[] { RFCCase});

return ((EFCCaseTypeCardIndex[])(results[0]));


[System.Xml.Serialization.XmlTypeAttribute(Namespac e=http://www.xxx.ch)]

[System.Xml.Serialization.XmlRootAttribute(Namespac e=http://www.xxx.ch,

public class RFCSending : sendingType {
/// <remarks/>

[System.Xml.Serialization.XmlArrayItemAttribute("ca rdIndex",

public RFCCaseTypeCardIndex[] RFCCase;
/// <remarks/>

[System.Xml.Serialization.XmlAttributeAttribute("gr oupe-id")]

public int groupeid;
/// <remarks/>


public bool groupeidSpecified;


The generated SOAP header looks like:

- <soap:Header>
- <RFCSending sending-date="2004-07-12T10:35:09.2208717+02:00"
sending-id="1" xmlns="http://www.ofac.ch/XEDO">
<sender code="1" />
<recipient code="4" />
It seems that only the attributes in the base class 'sendingType' are
generated. Why?



Nov 21 '05 #1
1 3046
I am going to guess here that the 'groupeid' attribute is defined in the
schema with use="optional" and type="xs:int", the schema type "int" will be
mapped to CLR primitive type System.Int32, which is a ValueType, so after
an instance of RFCSending is deserialized there is no way to tell if the
groupeid=".." attribute was present in the instance. XmlSerializer employs
xxxSpecified pattern to determine if the satellite xxx member was set or
not. When reading an instance of RFCSending, the groupeidSpecified member
will be set to "true" if the xml instance had the groupeid=".." attribute,
otherwise the value of the groupeidSpecified will be false. Unfortunately
this means that user is burdened with responsibility of setting the
groupeidSpecified to true if he/she want is to be serialized:

MyProxy x = new MyProxy();
x.RFCSendingValue = new RFCSending();
x.RFCSendingValue.groupeid = 555;
x.RFCSendingValue. groupeidSpecified = true;

Nov 21 '05 #2

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

Similar topics

by: Alexandre T. | last post by:
Hi, I am currently using xsd.exe to generate C# classes from XSDs. Sample XSD file: <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault=" qualified"...
by: Timo | last post by:
When I use XML serialization to serialize a collection of MyObject, all of the public fields of the object are being serialized, even those I've given the <NonSerialized()> attribute. ...
by: Neil Norfolk | last post by:
I am using C# in Visual Studio 2003. I would like to serialize a class that contains, amongst other things, public delegate void DocumentsPreferencesChange(object env, Documents e); public event...
by: Crispin Horsfield | last post by:
It's not useful to serialize events in a class that can be serialized so in C# you can use the 'field' attribute to mark events as 'NonSerializable'.This is not available in VB. Does anyone know...
by: Samuel R. Neff | last post by:
Is there a way to add the NonSerialized attribute to the "Event" fields that the VB.NET compiler creates when you declare an event? I have a class that we use with binary serialization and we...
by: Timo | last post by:
When I use XML serialization to serialize MyCustomObjectCollection, all of the public fields of MyCustomObject are being serialized, even those I've given the <NonSerialized()> attribute. ...
by: ryansupak | last post by:
Hi, I'm serializing C# objects, only I'm creating attribute-normal XML instead of (the default) element-normal XML. For each item that gets serialized, I'm programmatically applying an...
by: Henrik Dahl | last post by:
Hello! I have an xml schema which has a date typed attribute. I have used xsd.exe to create a class library for XmlSerializer. The result of XmlSerializer.Serialize(...) should be passed as the...
by: Matt Kruse | last post by:
According to standards, if an option is selected and it has no VALUE attribute, the contents of the option tag is to be submitted. So: <select name="sel"> <option selected>Value</option>...
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge required to effectively administer and manage Oracle...
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was proposed, which integrated multiple engines and...
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it so the python app could use a http request to get...
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and...
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and credentials and received a successful connection...
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific technical details, Gmail likely implements measures...
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand. Background colors can be used to highlight important...
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python has gained popularity among beginners and experts...
by: Ricardo de Mila | last post by:
Dear people, good afternoon... I have a form in msAccess with lots of controls and a specific routine must be triggered if the mouse_down event happens in any control. Than I need to discover what...

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.