axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ami...@apache.org
Subject svn commit: r565235 - /webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/ConverterUtil.java
Date Mon, 13 Aug 2007 04:31:05 GMT
Author: amilas
Date: Sun Aug 12 21:31:04 2007
New Revision: 565235

URL: http://svn.apache.org/viewvc?view=rev&rev=565235
Log:
fixed an issue with reading the anytype objects

Modified:
    webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/ConverterUtil.java

Modified: webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/ConverterUtil.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/ConverterUtil.java?view=diff&rev=565235&r1=565234&r2=565235
==============================================================================
--- webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/ConverterUtil.java
(original)
+++ webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/ConverterUtil.java
Sun Aug 12 21:31:04 2007
@@ -32,6 +32,7 @@
 
 import javax.activation.DataHandler;
 import javax.xml.namespace.QName;
+import javax.xml.namespace.NamespaceContext;
 import javax.xml.stream.XMLStreamException;
 import javax.xml.stream.XMLStreamReader;
 import javax.xml.stream.XMLStreamWriter;
@@ -1129,6 +1130,10 @@
     public static Object getAnyTypeObject(XMLStreamReader xmlStreamReader) throws XMLStreamException
{
         Object returnObject = null;
 
+        // make sure reader is at the first element.
+        while(!xmlStreamReader.isStartElement()){
+            xmlStreamReader.next();
+        }
         // first check whether this element is null or not
         String nillableValue = xmlStreamReader.getAttributeValue(Constants.XSI_NAMESPACE,
"nil");
         if ("true".equals(nillableValue) || "1".equals(nillableValue)){
@@ -1139,7 +1144,10 @@
                 if (attributeType.indexOf(":") > -1) {
                     attributeType = attributeType.substring(attributeType.indexOf(":") +
1);
                 }
-                String attribValue = xmlStreamReader.getElementText();
+                NamespaceContext namespaceContext = xmlStreamReader.getNamespaceContext();
+                xmlStreamReader.next();
+
+                String attribValue = xmlStreamReader.getText();
                 if (attribValue != null){
                     if (attributeType.equals("string")) {
                         returnObject = attribValue;
@@ -1151,7 +1159,7 @@
                         if (attribValue.indexOf(":") > -1){
                             namespacePrefix = attribValue.substring(0,attribValue.indexOf(":"));
                             localPart = attribValue.substring(attribValue.indexOf(":") +
1);
-                            returnObject = new QName(xmlStreamReader.getNamespaceURI(namespacePrefix),localPart);
+                            returnObject = new QName(namespaceContext.getNamespaceURI(namespacePrefix),localPart);
                         }
                     } else if ("boolean".equals(attributeType)) {
                         returnObject = new Boolean(attribValue);



---------------------------------------------------------------------
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