Return-Path: Delivered-To: apmail-xml-axis-user-archive@xml.apache.org Received: (qmail 83499 invoked by uid 500); 2 Dec 2002 20:40:20 -0000 Mailing-List: contact axis-user-help@xml.apache.org; run by ezmlm Precedence: bulk Reply-To: axis-user@xml.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list axis-user@xml.apache.org Received: (qmail 83490 invoked from network); 2 Dec 2002 20:40:20 -0000 Message-ID: From: Tom Jordahl To: "'axis-user@xml.apache.org'" Subject: RE: RESPOST: Usage of optional attributes Date: Mon, 2 Dec 2002 15:40:21 -0500 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2653.19) Content-Type: text/plain; charset="iso-8859-1" X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N 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.