axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tom Jordahl <>
Subject RE: RESPOST: Usage of optional attributes
Date Tue, 03 Dec 2002 15:12:14 GMT

We wouldn't change anything that broke JAX-RPC.
The bean type would have to be special, so a reset() method would be no problem....

Tom Jordahl 
Macromedia Server Development 
 -----Original Message-----
From: Matthias David []
Sent: Tuesday, December 03, 2002 3:33 AM
To: ''
Subject: RE: RESPOST: Usage of optional attributes

Thanks Tom for your answer! 
I already thought of something like the JavaBean you described. But the problem with that
solution is that once you've set the Bean the first time you cannot reset it unless you can
set the boolean flag. E.g. with a special method like "reset".
But there could be a simpler solution. How about mapping simple datatypes to real Objects
like Integer, Long, Double, etc. instead of using the simple types? Ok, that solution is not
conform to the JAX-RPC specifiaction as described in the Axis User's Guide on page 14. But
I could use it as a first workaround. So is there a simple possibility to change the mapping
for these datatypes?
-----Original Message----- 
From: Tom Jordahl [] 
Sent: Monday, December 02, 2002 9:40 PM 
To: '' 
Subject: RE: RESPOST: Usage of optional attributes 

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 [] 
Sent: Wednesday, November 27, 2002 3:14 AM 
To: '' 
Subject: RESPOST: Usage of optional attributes 

(This time without HTML. I hate Outlook) 
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? 

View raw message