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 to...@apache.org on 2004/11/12 21:20:37 UTC

cvs commit: ws-axis/java/src/org/apache/axis/encoding/ser MapSerializer.java

tomj        2004/11/12 12:20:37

  Modified:    java/src/org/apache/axis/encoding/ser MapSerializer.java
  Log:
  Map serializer fix: Map keys and values can be any type, so should always
  send xsi:type information on those elements.
  Also, get the current encoding from the message context so we do not
  emit a soapenc prefix when using literal serialization.
  
  Revision  Changes    Path
  1.27      +4 -3      ws-axis/java/src/org/apache/axis/encoding/ser/MapSerializer.java
  
  Index: MapSerializer.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/java/src/org/apache/axis/encoding/ser/MapSerializer.java,v
  retrieving revision 1.26
  retrieving revision 1.27
  diff -u -r1.26 -r1.27
  --- MapSerializer.java	25 Feb 2004 14:02:37 -0000	1.26
  +++ MapSerializer.java	12 Nov 2004 20:20:37 -0000	1.27
  @@ -76,7 +76,7 @@
           context.startElement(name, attributes);
           
           AttributesImpl itemsAttributes = new AttributesImpl();
  -        String encodingURI = context.getMessageContext().getSOAPConstants().getEncodingURI();
  +        String encodingURI = context.getMessageContext().getEncodingStyle();
           String encodingPrefix = context.getPrefixForURI(encodingURI);
           String soapPrefix = context.getPrefixForURI(Constants.SOAP_MAP.getNamespaceURI());
           itemsAttributes.addAttribute(encodingURI, "type", encodingPrefix + ":type",
  @@ -92,8 +92,9 @@
   
               context.startElement(QNAME_ITEM, null);
   
  -            context.serialize(QNAME_KEY,   null, key);
  -            context.serialize(QNAME_VALUE, null, val);
  +            // Since the Key and Value can be any type, send type info
  +            context.serialize(QNAME_KEY,   null, key, null, null, Boolean.TRUE);
  +            context.serialize(QNAME_VALUE, null, val, null, null, Boolean.TRUE);
   
               context.endElement();
           }