axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dee...@apache.org
Subject svn commit: r546662 - in /webservices/axis2/trunk/java/modules/adb: src/org/apache/axis2/databinding/utils/reader/ADBXMLStreamReaderImpl.java test/org/apache/axis2/databinding/utils/reader/ADBXMLStreamReaderTest.java
Date Tue, 12 Jun 2007 23:15:34 GMT
Author: deepal
Date: Tue Jun 12 16:15:33 2007
New Revision: 546662

URL: http://svn.apache.org/viewvc?view=rev&rev=546662
Log:
fixing AXIS2-1598

Modified:
    webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/reader/ADBXMLStreamReaderImpl.java
    webservices/axis2/trunk/java/modules/adb/test/org/apache/axis2/databinding/utils/reader/ADBXMLStreamReaderTest.java

Modified: webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/reader/ADBXMLStreamReaderImpl.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/reader/ADBXMLStreamReaderImpl.java?view=diff&rev=546662&r1=546661&r2=546662
==============================================================================
--- webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/reader/ADBXMLStreamReaderImpl.java
(original)
+++ webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/reader/ADBXMLStreamReaderImpl.java
Tue Jun 12 16:15:33 2007
@@ -3,6 +3,7 @@
 import org.apache.axiom.om.OMAttribute;
 import org.apache.axiom.om.OMElement;
 import org.apache.axiom.om.OMNamespace;
+import org.apache.axiom.om.impl.util.OMSerializerUtil;
 import org.apache.axis2.databinding.ADBBean;
 import org.apache.axis2.databinding.utils.BeanUtil;
 import org.apache.axis2.description.java2wsdl.TypeTable;
@@ -16,6 +17,7 @@
 import java.util.Arrays;
 import java.util.HashMap;
 import java.util.Map;
+import java.util.Iterator;
 /*
  * Copyright 2004,2005 The Apache Software Foundation.
  *
@@ -58,6 +60,10 @@
     private Object[] properties;
     private Object[] attributes;
     private QName elementQName;
+
+    //This is to store the QName which are in the typeTable after setting the corrcet prefix
+    private HashMap qnameMap = new HashMap();
+
     //we always create a new namespace context
     private ADBNamespaceContext namespaceContext = new ADBNamespaceContext();
 
@@ -110,6 +116,26 @@
         this(adbBeansQName, properties, attributes);
         this.qualified = qualified;
         this.typeTable = typeTable;
+        if(this.typeTable!=null){
+            Map complextTyepMap = this.typeTable.getComplexSchemaMap();
+            if(complextTyepMap!=null){
+                Iterator keyps = complextTyepMap.keySet().iterator();
+                while (keyps.hasNext()) {
+                    String key = (String) keyps.next();
+                    QName qname = (QName) complextTyepMap.get(key);
+                    if(qname!=null){
+                        String prefix =qname.getPrefix();
+                        if(prefix==null&&"".equals(prefix)){
+                            prefix = OMSerializerUtil.getNextNSPrefix();
+                        }
+                        qname = new QName(qname.getNamespaceURI(),qname.getLocalPart(),prefix);
+                        this.typeTable.getComplexSchemaMap().put(key,qname);
+                        qnameMap.put(qname.getNamespaceURI(),prefix);
+                        addToNsMap(prefix, qname.getNamespaceURI());
+                    }
+                }
+            }
+        }
     }
 
     /** add the namespace context */
@@ -850,6 +876,13 @@
             //oops - we've no idea what kind of key this is
             throw new XMLStreamException(
                     "unidentified property key!!!" + propPointer);
+        }
+
+        if(propertyQName!=null){
+            String prefix = (String) qnameMap.get(propertyQName.getNamespaceURI());
+            if(prefix!=null){
+                propertyQName = new QName(propertyQName.getNamespaceURI(),propertyQName.getLocalPart(),prefix);
+            }
         }
 
         //ok! we got the key. Now look at the value

Modified: webservices/axis2/trunk/java/modules/adb/test/org/apache/axis2/databinding/utils/reader/ADBXMLStreamReaderTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb/test/org/apache/axis2/databinding/utils/reader/ADBXMLStreamReaderTest.java?view=diff&rev=546662&r1=546661&r2=546662
==============================================================================
--- webservices/axis2/trunk/java/modules/adb/test/org/apache/axis2/databinding/utils/reader/ADBXMLStreamReaderTest.java
(original)
+++ webservices/axis2/trunk/java/modules/adb/test/org/apache/axis2/databinding/utils/reader/ADBXMLStreamReaderTest.java
Tue Jun 12 16:15:33 2007
@@ -653,6 +653,7 @@
         } catch (IOException e) {
             fail("Error has occurred " + e);
         } catch (Exception e) {
+            e.printStackTrace();
             fail("Error has occurred " + e);
         }
     }



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org


Mime
View raw message