axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tom Jordahl <t...@macromedia.com>
Subject RE: RESPOST: Usage of optional attributes
Date Mon, 02 Dec 2002 20:40:21 GMT

Obviously, as you have discovered, Axis doesn't do this 'right'.  But the problem is not simple,
as we have to define how to represent attributes that are optional in Java.

Off the top of my head:
How about a JavaBean with a data member and a boolean that indicate if the data has been set.
 It will have to have its own serializer/deserializer.  This could also handle default attribute
values as well (which we don't do either), the emitted Bean would have the default value set.

You might search the bug list to see if this lack has already been filed, but if not capturing
this mail conversation in a bugzilla report would be useful.

Care to contribute an implementation?

-- 
Tom Jordahl 
Macromedia Server Development 


-----Original Message-----
From: Matthias David [mailto:Matthias.David@ptv.de]
Sent: Wednesday, November 27, 2002 3:14 AM
To: 'axis-user@xml.apache.org'
Subject: RESPOST: Usage of optional attributes


(This time without HTML. I hate Outlook) 
Hi, 
I'm not sure, if this has been discussed before (I searched the list for 'optional attributes').
If so, please sent me a hint for that thread.
My question is: How can I make usage of optional attributes with Axis and WSDL2Java, if the
type of the attribute is mapped to a simple type? For example an attribute of type long cannot
be optional as it always has the default value 0. So it will always be present in a serialized
SOAP request whether it's optinal or not.
I found out that attributes are mapped to Objects (Long, Integer, ...) if the attribute is
marked as "nillable" in the wsdl file. But the XSD spec says that "nillable" is not allowed
for attributes. So this is not really a good solution.
Any clues? 
Thanks, 
 Matthias. 

Mime
View raw message