469,578 Members | 1,914 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,578 developers. It's quick & easy.

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 2943
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Alexandre T. | last post: by
1 post views Thread by Timo | last post: by
5 posts views Thread by Neil Norfolk | last post: by
2 posts views Thread by Crispin Horsfield | last post: by
reply views Thread by suresh191 | last post: by
4 posts views Thread by guiromero | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.