You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by bu...@apache.org on 2003/01/28 11:01:18 UTC

DO NOT REPLY [Bug 16485] New: - BeadDeserializer error when XML element starts with a capital letter

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=16485>.
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=16485

BeadDeserializer error when XML element starts with a capital letter

           Summary: BeadDeserializer error when XML element starts with a
                    capital letter
           Product: Axis
           Version: 1.1beta
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Serialization/Deserialization
        AssignedTo: axis-dev@xml.apache.org
        ReportedBy: antelder@apache.org


The AXIS BeanDeserializer doesn't work with some Java beans when the incoming
XML has elements which start with a capital letter, which seems to be common
with .Net generated WSDL.

For a more complete description see this axis-user thread where the problem is
diagnosed: http://marc.theaimsgroup.com/?l=axis-user&m=104203757522912&w=2

I've tested with the fix proposed on axis-user and it seems to work ok. Here's
the CVS diff:

Index: BeanDeserializer.java
===================================================================
RCS file:
/home/cvspublic/xml-axis/java/src/org/apache/axis/encoding/ser/BeanDeserializer.java,v
retrieving revision 1.55
diff -u -r1.55 BeanDeserializer.java
--- BeanDeserializer.java	24 Sep 2002 23:27:35 -0000	1.55
+++ BeanDeserializer.java	28 Jan 2003 09:50:55 -0000
@@ -214,6 +214,10 @@
         if (propDesc == null) {
             // look for a field by this name.
             propDesc = (BeanPropertyDescriptor) propertyMap.get(localName);
+            if (propDesc == null) {
+            	String ln = Character.toLowerCase(localName.charAt(0)) +
localName.substring(1);
+            	propDesc = (BeanPropertyDescriptor) propertyMap.get(ln);
+            }
         }
 
         // try and see if this is an xsd:any namespace="##any" element before