axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Glen Daniels <gdani...@macromedia.com>
Subject Yo David! (was "Axis Chokes on Complex Types from MS Soap 3.0)
Date Tue, 13 Aug 2002 15:01:04 GMT

Hi David:

Could you try your the .NET example that was failing with the latest CVS?

--Glen

-----Original Message-----
From: gdaniels@apache.org [mailto:gdaniels@apache.org]
Sent: Tuesday, August 13, 2002 10:59 AM
To: xml-axis-cvs@apache.org
Subject: cvs commit: xml-axis/java/src/org/apache/axis/encoding/ser
BeanDeserializer.java BeanSerializer.java


gdaniels    2002/08/13 07:58:58

  Modified:    java/src/org/apache/axis/encoding/ser BeanDeserializer.java
                        BeanSerializer.java
  Log:
  Use unqualified element names when using SOAP encoding, per
  section-5 rules.  Note that this change does NOT remove the
  namespace from the TypeDesc/FieldDesc - this means that we can
  take the same Java representation of a schema type and use it in
  both encoded (unqualified field names) and literal (field names which
  follow the schema exactly) situations.
  
  Revision  Changes    Path
  1.44      +10 -7     xml-axis/java/src/org/apache/axis/encoding/ser/BeanDeserializer.java
  
  Index: BeanDeserializer.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/encoding/ser/BeanDeserializer.java,v
  retrieving revision 1.43
  retrieving revision 1.44
  diff -u -r1.43 -r1.44
  --- BeanDeserializer.java	8 Aug 2002 14:35:48 -0000	1.43
  +++ BeanDeserializer.java	13 Aug 2002 14:58:58 -0000	1.44
  @@ -185,7 +185,10 @@
           throws SAXException
       {
           BeanPropertyDescriptor propDesc = null;
  -        
  +
  +        String encodingStyle = context.getMessageContext().getEncodingStyle();
  +        boolean isEncoded = Constants.isSOAP_ENC(encodingStyle);
  +
           QName elemQName = new QName(namespace, localName);
           // The collectionIndex needs to be reset for Beans with multiple arrays
           if ((prevQName == null) || (!prevQName.equals(elemQName))) {
  @@ -201,12 +204,12 @@
               // name is not prefixed, lookup the name assuming an unqualified
               // name.
               String fieldName = typeDesc.getFieldNameForElement(elemQName, 
  -                                                               false);
  -            if (fieldName == null && (prefix == null || prefix.equals(""))) {
  -                fieldName = 
  -                    typeDesc.getFieldNameForElement(
  -                      new QName("", elemQName.getLocalPart()), false);
  -            }
  +                                                               isEncoded);
  +//            if (fieldName == null && (prefix == null || prefix.equals(""))) {
  +//                fieldName =
  +//                    typeDesc.getFieldNameForElement(
  +//                      new QName("", elemQName.getLocalPart()), false);
  +//            }
   
               propDesc = (BeanPropertyDescriptor)propertyMap.get(fieldName);
           }
  
  
  
  1.47      +11 -2     xml-axis/java/src/org/apache/axis/encoding/ser/BeanSerializer.java
  
  Index: BeanSerializer.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/encoding/ser/BeanSerializer.java,v
  retrieving revision 1.46
  retrieving revision 1.47
  diff -u -r1.46 -r1.47
  --- BeanSerializer.java	7 Aug 2002 22:31:33 -0000	1.46
  +++ BeanSerializer.java	13 Aug 2002 14:58:58 -0000	1.47
  @@ -145,6 +145,7 @@
   
           // Get the encoding style
           String encodingStyle = context.getMessageContext().getEncodingStyle();
  +        boolean isEncoded = Constants.isSOAP_ENC(encodingStyle);
   
           // check whether we have and xsd:any namespace="##any" type
           boolean suppressElement = !context.getMessageContext().isEncoded() &&
  @@ -174,7 +175,15 @@
                           if (!field.isElement())
                               continue;
   
  -                        qname = field.getXmlName();
  +                        // If we're SOAP encoded, just use the local part,
  +                        // not the namespace.  Otherwise use the whole
  +                        // QName.
  +                        if (isEncoded) {
  +                            qname = new QName(
  +                                          field.getXmlName().getLocalPart());
  +                        } else {
  +                            qname = field.getXmlName();
  +                        }
                           isOmittable = field.isMinOccursIs0();
                       }
                   }
  @@ -196,7 +205,7 @@
                           // encoding.
                           if (propValue == null &&
                                   isOmittable &&
  -                                !Constants.isSOAP_ENC(encodingStyle))
  +                                !isEncoded)
                               continue;
   
                           context.serialize(qname,
  
  
  

Mime
View raw message