ws-axis-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject cvs commit: ws-axis/java/src/org/apache/axis/encoding DeserializationContext.java
Date Mon, 01 Nov 2004 14:07:35 GMT
dims        2004/11/01 06:07:35

  Modified:    java/src/org/apache/axis/encoding/ser BeanDeserializer.java
               java/src/org/apache/axis/encoding
                        DeserializationContext.java
  Log:
  Fix for AXIS-1632 - NPE Using DeserializationContext
  from Steve Green (steve.green@epok.net)
  
  Revision  Changes    Path
  1.70      +1 -1      ws-axis/java/src/org/apache/axis/encoding/ser/BeanDeserializer.java
  
  Index: BeanDeserializer.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/java/src/org/apache/axis/encoding/ser/BeanDeserializer.java,v
  retrieving revision 1.69
  retrieving revision 1.70
  diff -u -r1.69 -r1.70
  --- BeanDeserializer.java	29 Jul 2004 21:40:27 -0000	1.69
  +++ BeanDeserializer.java	1 Nov 2004 14:07:35 -0000	1.70
  @@ -156,7 +156,7 @@
           FieldDesc fieldDesc = null;
   
           SOAPConstants soapConstants = context.getSOAPConstants();
  -        String encodingStyle = context.getMessageContext().getEncodingStyle();
  +        String encodingStyle = context.getEncodingStyle();
           boolean isEncoded = Constants.isSOAP_ENC(encodingStyle);
   
           QName elemQName = new QName(namespace, localName);
  
  
  
  1.60      +16 -10    ws-axis/java/src/org/apache/axis/encoding/DeserializationContext.java
  
  Index: DeserializationContext.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/java/src/org/apache/axis/encoding/DeserializationContext.java,v
  retrieving revision 1.59
  retrieving revision 1.60
  diff -u -r1.59 -r1.60
  --- DeserializationContext.java	14 Sep 2004 06:14:01 -0000	1.59
  +++ DeserializationContext.java	1 Nov 2004 14:07:35 -0000	1.60
  @@ -21,6 +21,7 @@
   import org.apache.axis.Constants;
   import org.apache.axis.Message;
   import org.apache.axis.AxisFault;
  +import org.apache.axis.constants.Use;
   import org.apache.axis.attachments.Attachments;
   import org.apache.axis.description.TypeDesc;
   import org.apache.axis.soap.SOAPConstants;
  @@ -270,6 +271,19 @@
       }
   
       /**
  +     * Returns this context's encoding style.  If we've got a message
  +     * context then we'll get the style from that; otherwise we'll
  +     * return a default.
  +     *
  +     * @return a <code>String</code> value
  +     */
  +    public String getEncodingStyle() 
  +    {
  +        return msgContext == null ?
  +                Use.ENCODED.getEncoding() : msgContext.getEncodingStyle();
  +    }    
  +
  +    /**
        * Get Envelope
        */
       public SOAPEnvelope getEnvelope()
  @@ -490,7 +504,7 @@
                   TypeDesc typedesc = TypeDesc.getTypeDescForClass(cls);
                   if (typedesc != null) {
                       dser = (Deserializer) method.invoke(null,
  -                        new Object[] {msgContext.getEncodingStyle(), cls, typedesc.getXmlType()});
  +                        new Object[] {getEncodingStyle(), cls, typedesc.getXmlType()});
                   }
               }
           } catch (Exception e) {
  @@ -539,15 +553,7 @@
                       null);
           }
           TypeMappingRegistry tmr = msgContext.getTypeMappingRegistry();
  -        return (TypeMapping) tmr.getTypeMapping(msgContext.getEncodingStyle());
  -        /*
  -         * TODO: This code doesn't yet work, but we aren't looking up the right
  -         * TypeMapping by just using SOAP_ENC.
  -
  -        String encStyle = curElement == null ? Constants.NS_URI_CURRENT_SOAP_ENC :
  -                                               curElement.getEncodingStyle();
  -        return (TypeMapping) tmr.getTypeMapping(encStyle);
  -        */
  +        return (TypeMapping) tmr.getTypeMapping(getEncodingStyle());
       }
   
       /**
  
  
  

Mime
View raw message