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 he...@apache.org on 2004/12/22 14:54:13 UTC

svn commit: r123092 - in webservices/axis/trunk/java/dev/scratch/prototype2/src: java/org/apache/axis/engine java/org/apache/axis/impl/providers java/org/apache/axis/om test/org/apache/axis test/org/apache/axis/clientapi

Author: hemapani
Date: Wed Dec 22 05:54:11 2004
New Revision: 123092

URL: http://svn.apache.org/viewcvs?view=rev&rev=123092
Log:
update the engine to fix the bug when there are wite spacess in the body
Added:
   webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/om/OMUtils.java
Modified:
   webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/engine/AxisEngine.java
   webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/providers/RawXMLProvider.java
   webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/AbstractTestCase.java
   webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/clientapi/AsyncResultTest.java

Modified: webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/engine/AxisEngine.java
Url: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/engine/AxisEngine.java?view=diff&rev=123092&p1=webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/engine/AxisEngine.java&r1=123091&p2=webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/engine/AxisEngine.java&r2=123092
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/engine/AxisEngine.java	(original)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/engine/AxisEngine.java	Wed Dec 22 05:54:11 2004
@@ -67,7 +67,6 @@
             //Start rolling the Service Handlers will,be added by the Dispatcher 
             chain.invoke(context);
         } catch (AxisFault e) {
-            e.printStackTrace();
             handleFault(context, e);
         }
     }

Modified: webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/providers/RawXMLProvider.java
Url: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/providers/RawXMLProvider.java?view=diff&rev=123092&p1=webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/providers/RawXMLProvider.java&r1=123091&p2=webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/providers/RawXMLProvider.java&r2=123092
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/providers/RawXMLProvider.java	(original)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/providers/RawXMLProvider.java	Wed Dec 22 05:54:11 2004
@@ -16,6 +16,11 @@
 
 package org.apache.axis.impl.providers;
 
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+
+import javax.xml.namespace.QName;
+
 import org.apache.axis.context.MessageContext;
 import org.apache.axis.context.SessionContext;
 import org.apache.axis.description.AxisService;
@@ -25,15 +30,11 @@
 import org.apache.axis.engine.Provider;
 import org.apache.axis.om.OMElement;
 import org.apache.axis.om.OMFactory;
+import org.apache.axis.om.OMUtils;
 import org.apache.axis.om.SOAPEnvelope;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
-import javax.xml.namespace.QName;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.util.Iterator;
-
 /**
  * This is a Simple java Provider.
  */
@@ -115,14 +116,11 @@
                     break;
                 }
             }
+            
+            OMElement methodElement = OMUtils.getFirstChildElement(msgContext.getEnvelope().getBody());
+            OMElement parmeter = OMUtils.getFirstChildElement(methodElement);
 
-            Iterator it = msgContext.getEnvelope().getBody().getChildren();
-
-            Object[] parms = null;
-            if (it.hasNext()) {
-                parms = new Object[]{it.next()};
-                ;
-            }
+            Object[] parms = new Object[]{parmeter};
             //invoke the WebService 
             OMElement result = (OMElement) method.invoke(obj, parms);
             MessageContext msgContext1 = new MessageContext(msgContext.getGlobalContext().getRegistry());

Added: webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/om/OMUtils.java
Url: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/om/OMUtils.java?view=auto&rev=123092
==============================================================================
--- (empty file)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/om/OMUtils.java	Wed Dec 22 05:54:11 2004
@@ -0,0 +1,42 @@
+/*
+ * Copyright 2003,2004 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.axis.om;
+
+import java.util.Iterator;
+
+
+public class OMUtils {
+    public static OMElement getFirstChildElement(OMElement omele){
+        OMElement childElement = null;
+        OMNode child = null;
+        if(omele != null){
+            Iterator it = omele.getChildren();
+            if(it.hasNext()){
+                child = (OMNode)it.next();
+                while(OMNode.ELEMENT_NODE != child.getType()){
+                    if(it.hasNext()){
+                        child = (OMNode)it.next();
+                    }else{
+                        break;
+                    }
+                }
+                childElement = (OMElement)child;
+            }
+            
+        }
+        return childElement;
+    }
+}

Modified: webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/AbstractTestCase.java
Url: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/AbstractTestCase.java?view=diff&rev=123092&p1=webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/AbstractTestCase.java&r1=123091&p2=webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/AbstractTestCase.java&r2=123092
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/AbstractTestCase.java	(original)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/AbstractTestCase.java	Wed Dec 22 05:54:11 2004
@@ -16,9 +16,9 @@
  
 package org.apache.axis;
 
-import junit.framework.TestCase;
-
 import java.io.File;
+
+import junit.framework.TestCase;
 
 /**
  * Abstract base class for test cases.

Modified: webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/clientapi/AsyncResultTest.java
Url: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/clientapi/AsyncResultTest.java?view=diff&rev=123092&p1=webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/clientapi/AsyncResultTest.java&r1=123091&p2=webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/clientapi/AsyncResultTest.java&r2=123092
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/clientapi/AsyncResultTest.java	(original)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/clientapi/AsyncResultTest.java	Wed Dec 22 05:54:11 2004
@@ -20,8 +20,6 @@
 package org.apache.axis.clientapi;
 
 import junit.framework.TestCase;
-import org.apache.axis.om.SOAPEnvelope;
-import org.apache.axis.om.OMFactory;
 
 
 public class AsyncResultTest extends TestCase {