473,396 Members | 2,154 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,396 software developers and data experts.

Attribute missing / not serialized

Hi,

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,
Required=true)]

[System.Web.Services.Protocols.SoapHeaderAttribute( "EFCSendingValue",
Direction=System.Web.Services.Protocols.SoapHeader Direction.Out,
Required=true)]

[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",
Namespace=http://www.)]

[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,
IsNullable=false)]

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

[System.Xml.Serialization.XmlArrayItemAttribute("ca rdIndex",
IsNullable=false)]

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

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

public int groupeid;
/// <remarks/>

[System.Xml.Serialization.XmlIgnoreAttribute()]

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" />
</RFCSending>
</soap:Header>
It seems that only the attributes in the base class 'sendingType' are
generated. Why?

Thanks

Eric


Nov 21 '05 #1
1 3128
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

0
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"...
1
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. ...
5
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...
2
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...
5
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...
2
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. ...
0
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...
10
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...
4
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>...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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
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
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
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
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.