axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 25486] New: - deserializing attribute of type hexBinary throws exception
Date Fri, 12 Dec 2003 18:11:04 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=25486>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=25486

deserializing attribute of type hexBinary throws exception

           Summary: deserializing attribute of type hexBinary throws
                    exception
           Product: Axis
           Version: current (nightly)
          Platform: All
        OS/Version: Other
            Status: NEW
          Severity: Blocker
          Priority: Other
         Component: Serialization/Deserialization
        AssignedTo: axis-dev@ws.apache.org
        ReportedBy: kbrichan@comcast.net


With a WSDL containing an ATTRIBUTE declaration of type xsd:hexBinary, two 
problems occur:

1. Base64Deserializer chosen instead of HexDeserializer.

WSDL2Java properly generates the attribute's type to be "byte[]" and properly 
generates setXmlType to "hexBinary".

HOWEVER, at runtime, encoding.ser.BeanDeserializer.onStartElement calls 
getDeserializer which returns Base64Deserializer instead of HexDeserializer.

Bug 23258 is related, but for Java2WSDL instead of WSDL2Java.


2. SAXException thrown.

Whether getDeserializer returns Base64Deserializer or HexDeserializer, it 
doesn't matter, because onStartElement throws SAXException with 
message "AttrNotSimpleType00" since neither Base64Deserializer nor 
HexDeserializer are instanceof SimpleDeserializer.

Both hexBinary and base64Binary are legal types for attributes. See XML Schema 
Part 1: Structures, www.w3.org/TR/2001/REC-xmlschema-1-20010502/, sections 
3.2.2 and 3.14.7, which describe attributes can be simple types including: 
string, boolean, float, double, number, dateTime, duration, time, date, gMonth, 
gMonthDay, gDay, gYear, gYearMonth, > > > hexBinary, base64Binary, < < <
anyURI.

- - -

Run WSDL2Java on the attached WSDL.

Note for class _demographic_row, response_bits is byte[] and setXmlType 
is "hexBinary". However, at runtime, two problems: 1) the wrong deserializer is 
obtained (Base64 instead of Hex) and 2) neither Base64 nor HexDeserializer 
derive from SimpleDeserializer so a SAXException is thrown.

Mime
View raw message