axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dee...@apache.org
Subject svn commit: r513619 - in /webservices/axis2/trunk/java/modules: adb/src/org/apache/axis2/databinding/typemapping/ adb/src/org/apache/axis2/databinding/utils/ adb/src/org/apache/axis2/rpc/receivers/ java2wsdl/src/org/apache/ws/java2wsdl/ kernel/conf/ ke...
Date Fri, 02 Mar 2007 04:30:39 GMT
Author: deepal
Date: Thu Mar  1 20:30:39 2007
New Revision: 513619

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

Modified:
    webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/typemapping/SimpleTypeMapper.java
    webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/BeanUtil.java
    webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/rpc/receivers/RPCUtil.java
    webservices/axis2/trunk/java/modules/java2wsdl/src/org/apache/ws/java2wsdl/SchemaGenerator.java
    webservices/axis2/trunk/java/modules/kernel/conf/axis2.xml
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/axis2_default.xml

Modified: webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/typemapping/SimpleTypeMapper.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/typemapping/SimpleTypeMapper.java?view=diff&rev=513619&r1=513618&r2=513619
==============================================================================
--- webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/typemapping/SimpleTypeMapper.java
(original)
+++ webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/typemapping/SimpleTypeMapper.java
Thu Mar  1 20:30:39 2007
@@ -18,8 +18,14 @@
 package org.apache.axis2.databinding.typemapping;
 
 import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.OMNode;
+import org.apache.axiom.om.OMText;
+import org.apache.axiom.om.OMDataSource;
+import org.apache.axiom.attachments.utils.DataHandlerUtils;
 
 import javax.xml.namespace.QName;
+import javax.activation.DataHandler;
+import javax.activation.DataSource;
 import java.text.SimpleDateFormat;
 import java.util.*;
 
@@ -105,6 +111,20 @@
         return list;
     }
 
+    public static DataHandler getDataHandler(OMElement element) {
+        OMNode node =element.getFirstOMChild();
+        if (node instanceof OMText) {
+            OMText txt = (OMText) node;
+            if(txt.isOptimized()){
+                return (DataHandler) txt.getDataHandler();
+            } else {
+               return (DataHandler) DataHandlerUtils.getDataHandlerFromText(txt.getText(),null);
 
+            }
+        }
+        return null;
+    }
+
+
     public static ArrayList getArrayList(OMElement element) {
         Iterator childitr = element.getChildren();
         ArrayList list = new ArrayList();
@@ -130,6 +150,9 @@
         String objClassName = obj.getName();
         return isSimpleType(objClassName);
     }
+    public static boolean isDataHandler(Class obj){
+        return "javax.activation.DataHandler".equals(obj.getName());
+    }
 
     public static boolean isCollection(Class obj) {
         return java.util.Collection.class.isAssignableFrom(obj);
@@ -310,4 +333,5 @@
             return calendar;
         }
     }
+
 }

Modified: webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/BeanUtil.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/BeanUtil.java?view=diff&rev=513619&r1=513618&r2=513619
==============================================================================
--- webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/BeanUtil.java
(original)
+++ webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/BeanUtil.java
Thu Mar  1 20:30:39 2007
@@ -594,6 +594,8 @@
                     }
                 } else if (SimpleTypeMapper.isCollection(classType)) {
                     return SimpleTypeMapper.getArrayList(omElement);
+                }else if(SimpleTypeMapper.isDataHandler(classType)){
+                    return SimpleTypeMapper.getDataHandler(omElement);
                 } else {
                     return BeanUtil.deserialize(classType, omElement, objectSupplier, null);
                 }

Modified: webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/rpc/receivers/RPCUtil.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/rpc/receivers/RPCUtil.java?view=diff&rev=513619&r1=513618&r2=513619
==============================================================================
--- webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/rpc/receivers/RPCUtil.java
(original)
+++ webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/rpc/receivers/RPCUtil.java
Thu Mar  1 20:30:39 2007
@@ -1,8 +1,6 @@
 package org.apache.axis2.rpc.receivers;
 
-import org.apache.axiom.om.OMAbstractFactory;
-import org.apache.axiom.om.OMElement;
-import org.apache.axiom.om.OMNamespace;
+import org.apache.axiom.om.*;
 import org.apache.axiom.om.impl.builder.StAXOMBuilder;
 import org.apache.axiom.om.impl.llom.factory.OMXMLBuilderFactory;
 import org.apache.axiom.om.util.Base64;
@@ -231,7 +229,19 @@
                                 service.isElementFormDefault(),
                                 service.getTypeTable());
                         envelope.getBody().addChild(bodyChild);
-                    } else {
+                    } else if (SimpleTypeMapper.isDataHandler(resObject.getClass())){
+                        OMElement resElemt =  fac.createOMElement(method.getName() + "Response"
,ns);
+                        OMText text = fac.createOMText(resObject,true);
+                        OMElement returnElement;
+                        if(service.isElementFormDefault()){
+                            returnElement=   fac.createOMElement(RETURN_WRAPPER ,ns);
+                        } else {
+                            returnElement=   fac.createOMElement(RETURN_WRAPPER ,null);
+                        }
+                        returnElement.addChild(text);
+                        resElemt.addChild(returnElement);
+                        envelope.getBody().addChild(resElemt);
+                    }  else {
                         if (service.isElementFormDefault()) {
                             RPCUtil.processResponse(fac, resObject, bodyContent, ns,
                                     envelope, method, service.isElementFormDefault(),

Modified: webservices/axis2/trunk/java/modules/java2wsdl/src/org/apache/ws/java2wsdl/SchemaGenerator.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/java2wsdl/src/org/apache/ws/java2wsdl/SchemaGenerator.java?view=diff&rev=513619&r1=513618&r2=513619
==============================================================================
--- webservices/axis2/trunk/java/modules/java2wsdl/src/org/apache/ws/java2wsdl/SchemaGenerator.java
(original)
+++ webservices/axis2/trunk/java/modules/java2wsdl/src/org/apache/ws/java2wsdl/SchemaGenerator.java
Thu Mar  1 20:30:39 2007
@@ -395,7 +395,9 @@
             classTypeName = "base64Binary";
             isArrayType = false;
         }
-
+        if("javax.activation.DataHandler".equals(classTypeName)){
+            classTypeName = "base64Binary";
+        }
         QName schemaTypeName = typeTable.getSimpleSchemaTypeName(classTypeName);
         if (schemaTypeName == null) {
             schemaTypeName = generateSchema(type);

Modified: webservices/axis2/trunk/java/modules/kernel/conf/axis2.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/conf/axis2.xml?view=diff&rev=513619&r1=513618&r2=513619
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/conf/axis2.xml (original)
+++ webservices/axis2/trunk/java/modules/kernel/conf/axis2.xml Thu Mar  1 20:30:39 2007
@@ -63,10 +63,6 @@
     <!--<parameter name="servicePath" locked="false">services</parameter>-->
     <!--<parameter name="restPath" locked="false">rest</parameter>-->
 
-
-    <!--Set the flag to true if you want to enable transport level session mangment-->
-    <parameter name="manageTransportSession" locked="false">false</parameter>
-
     <!-- Following parameter will completely disable REST handling in Axis2-->
     <parameter name="disableREST" locked="true">false</parameter>
 

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/axis2_default.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/axis2_default.xml?view=diff&rev=513619&r1=513618&r2=513619
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/axis2_default.xml
(original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/axis2_default.xml
Thu Mar  1 20:30:39 2007
@@ -33,9 +33,6 @@
     <!--<parameter name="servicePath" locked="false">services</parameter>-->
     <!--<parameter name="restPath" locked="false">rest</parameter>-->
 
-    <!--Set the flag to true if you want to enable transport level session management-->
-    <parameter name="manageTransportSession" locked="false">false</parameter>
-
     <!-- Following parameter will completely disable REST handling in Axis2-->
     <parameter name="disableREST" locked="true">false</parameter>
 



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