Return-Path: Delivered-To: apmail-xml-axis-user-archive@xml.apache.org Received: (qmail 38701 invoked by uid 500); 3 Dec 2002 15:12:09 -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 38692 invoked from network); 3 Dec 2002 15:12:09 -0000 Message-ID: From: Tom Jordahl To: "'axis-user@xml.apache.org'" Subject: RE: RESPOST: Usage of optional attributes Date: Tue, 3 Dec 2002 10:12:14 -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 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 [mailto:Matthias.David@ptv.de] Sent: Tuesday, December 03, 2002 3:33 AM To: 'axis-user@xml.apache.org' 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? Matthias. -----Original Message----- From: Tom Jordahl [mailto:tomj@macromedia.com] Sent: Monday, December 02, 2002 9:40 PM To: 'axis-user@xml.apache.org' 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 [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.