You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by gd...@apache.org on 2005/10/24 06:12:24 UTC

svn commit: r327952 - in /webservices/axis2/trunk/java/modules/codegen: src/org/apache/axis2/databinding/ src/org/apache/axis2/databinding/typemapping/ test-resources/xmls/ test/org/apache/axis2/databinding/ test/org/apache/axis2/rpc/

Author: gdaniels
Date: Sun Oct 23 21:12:17 2005
New Revision: 327952

URL: http://svn.apache.org/viewcvs?rev=327952&view=rev
Log:
Get simple RPC test working by putting a minimal axis2.xml into the test-resources dir.  Still unclear why it was failing inside maven but not in IDEA before.

Also a few trivial other changes.

Added:
    webservices/axis2/trunk/java/modules/codegen/test-resources/xmls/MultiDimArray.xml
    webservices/axis2/trunk/java/modules/codegen/test-resources/xmls/axis2.xml
Modified:
    webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/databinding/DeserializationContext.java
    webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/databinding/typemapping/TypeMappingRegistry.java
    webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/databinding/ArrayTest.java
    webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/rpc/SimpleTest.java

Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/databinding/DeserializationContext.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/databinding/DeserializationContext.java?rev=327952&r1=327951&r2=327952&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/databinding/DeserializationContext.java (original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/databinding/DeserializationContext.java Sun Oct 23 21:12:17 2005
@@ -22,6 +22,7 @@
 import org.apache.axis2.databinding.metadata.TypeDesc;
 import org.apache.axis2.databinding.metadata.BeanManager;
 import org.apache.axis2.databinding.deserializers.BeanDeserializer;
+import org.apache.axis2.databinding.typemapping.TypeMappingRegistry;
 import org.apache.axis2.rpc.RPCMethod;
 import org.apache.axis2.rpc.RPCValues;
 import org.apache.axis2.rpc.RPCParameter;
@@ -43,6 +44,7 @@
     public static final String SOAP11_REF_ATTR = "href";
 
     private Map idToElementMap = new HashMap();
+    private TypeMappingRegistry tmr = new TypeMappingRegistry();
 
     Map waitingDescs = new HashMap();
     String refAttr = SOAP12_REF_ATTR;
@@ -127,6 +129,7 @@
 
     public Object deserializeToClass(XMLStreamReader reader,
                                      Class javaClass) throws Exception {
+
         TypeDesc typeDesc = BeanManager.getTypeDesc(javaClass);
         Deserializer dser = new BeanDeserializer(typeDesc);
 

Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/databinding/typemapping/TypeMappingRegistry.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/databinding/typemapping/TypeMappingRegistry.java?rev=327952&r1=327951&r2=327952&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/databinding/typemapping/TypeMappingRegistry.java (original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/databinding/typemapping/TypeMappingRegistry.java Sun Oct 23 21:12:17 2005
@@ -70,10 +70,16 @@
         return false;
     }
 
+    public boolean isCollection() {
+        return false;
+    }
+
     public DeserializerFactory getDeserializerFactory(Class cls) {
         if (isPrimitive(cls)) {
             return new SimpleDeserializerFactory(cls, new QName("xsd", cls.getName()));
         }
+
+        
 
         return new BeanDeserializerFactory(BeanManager.getTypeDesc(cls));
     }

Added: webservices/axis2/trunk/java/modules/codegen/test-resources/xmls/MultiDimArray.xml
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/test-resources/xmls/MultiDimArray.xml?rev=327952&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/test-resources/xmls/MultiDimArray.xml (added)
+++ webservices/axis2/trunk/java/modules/codegen/test-resources/xmls/MultiDimArray.xml Sun Oct 23 21:12:17 2005
@@ -0,0 +1,11 @@
+<wrapper>
+    <item>
+        <inner>one</inner>
+        <inner>two</inner>
+    </item>
+    <item>
+        <inner>1</inner>
+        <inner>2</inner>
+        <inner>3</inner>
+    </item>
+</wrapper>
\ No newline at end of file

Added: webservices/axis2/trunk/java/modules/codegen/test-resources/xmls/axis2.xml
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/test-resources/xmls/axis2.xml?rev=327952&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/test-resources/xmls/axis2.xml (added)
+++ webservices/axis2/trunk/java/modules/codegen/test-resources/xmls/axis2.xml Sun Oct 23 21:12:17 2005
@@ -0,0 +1,58 @@
+<axisconfig name="AxisJava2.0">
+    <!-- ================================================= -->
+    <!-- Parameters -->
+    <!-- ================================================= -->
+    <parameter name="enableMTOM" locked="false">true</parameter>
+
+    <parameter name="userName" locked="false">admin</parameter>
+    <parameter name="password" locked="false">axis2</parameter>
+
+    <parameter name="seralizeLocation" locked="false">.</parameter>
+
+    <!--Registering Axis Storage Class if you comment this default one will -->
+    <!--does the job (org.apache.axis2.storage.impl.AxisMemoryStorage) , if you-->
+    <!--want to register new one write a class by extanding AbastractStorage-->
+    <!--and put that name here-->
+    <axisStorage class="org.apache.axis2.storage.impl.AxisMemoryStorage">
+        <parameter name="StoreLocation" locked="false">N:S</parameter>
+    </axisStorage>
+
+    <!-- ================================================= -->
+    <!-- Message Receivers -->
+    <!-- ================================================= -->
+    <!-- This is the Deafult Message Receiver for the Request Response style Operations -->
+    <messageReceiver mep="INOUT" class="org.apache.axis2.receivers.RawXMLINOutMessageReceiver"/>
+
+    <!-- ================================================= -->
+    <!-- Transport Outs -->
+    <!-- ================================================= -->
+
+    <transportSender name="local" class="org.apache.axis2.transport.local.LocalTransportSender"/>
+
+    <!-- ================================================= -->
+    <!-- Phases  -->
+    <!-- ================================================= -->
+    <phaseOrder type="inflow">
+        <!--  System pre defined phases       -->
+        <phase name="TransportIn"/>
+        <phase name="PreDispatch"/>
+        <phase name="Dispatch"/>
+        <phase name="PostDispatch"/>
+        <!--  System pre defined phases       -->
+        <!--   After Postdispatch phase module author or or service author can add any phase he want      -->
+        <phase name="userphase1"/>
+    </phaseOrder>
+    <phaseOrder type="outflow">
+        <!--      user can add his own phases to this area  -->
+        <phase name="userphase1"/>
+    </phaseOrder>
+    <phaseOrder type="INfaultflow">
+        <!--      user can add his own phases to this area  -->
+        <phase name="userphase1"/>
+    </phaseOrder>
+    <phaseOrder type="Outfaultflow">
+        <!--      user can add his own phases to this area  -->
+        <phase name="userphase1"/>
+    </phaseOrder>
+</axisconfig>
+

Modified: webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/databinding/ArrayTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/databinding/ArrayTest.java?rev=327952&r1=327951&r2=327952&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/databinding/ArrayTest.java (original)
+++ webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/databinding/ArrayTest.java Sun Oct 23 21:12:17 2005
@@ -96,4 +96,26 @@
         assertEquals("two", bean.getCollection(1));
         assertEquals("three", bean.getCollection(2));
     }
+
+/*
+    public void testMultiDimArray() throws Exception {
+        InputStream is = new FileInputStream("test-resources/xmls/MultiDimArray.xml");
+        XMLStreamReader reader = XMLInputFactory.newInstance().createXMLStreamReader(is);
+
+        StAXOMBuilder builder = OMXMLBuilderFactory.createStAXOMBuilder(OMAbstractFactory.getOMFactory(), reader);
+        OMElement el = builder.getDocumentElement();
+        XMLStreamReader omReader = el.getXMLStreamReaderWithoutCaching();
+        omReader.next();
+        DeserializationContext context = new DeserializationContext();
+        Object value = context.deserializeToClass(omReader, TestBean.class);
+
+        assertNotNull(value);
+        assertTrue(value instanceof TestBean);
+        TestBean bean = (TestBean)value;
+        assertEquals("Wrong # of items", 3, bean.coll.size());
+        assertEquals("one", bean.getCollection(0));
+        assertEquals("two", bean.getCollection(1));
+        assertEquals("three", bean.getCollection(2));
+    }
+*/
 }

Modified: webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/rpc/SimpleTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/rpc/SimpleTest.java?rev=327952&r1=327951&r2=327952&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/rpc/SimpleTest.java (original)
+++ webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/rpc/SimpleTest.java Sun Oct 23 21:12:17 2005
@@ -16,34 +16,29 @@
 package org.apache.axis2.rpc;
 
 import junit.framework.TestCase;
+import org.apache.axis2.Constants;
+import org.apache.axis2.addressing.EndpointReference;
+import org.apache.axis2.clientapi.Call;
+import org.apache.axis2.context.ConfigurationContext;
+import org.apache.axis2.databinding.DeserializationContext;
 import org.apache.axis2.databinding.deserializers.SimpleDeserializerFactory;
 import org.apache.axis2.databinding.serializers.CollectionSerializer;
 import org.apache.axis2.databinding.serializers.SimpleSerializer;
-import org.apache.axis2.databinding.DeserializationContext;
+import org.apache.axis2.description.InOutOperationDescrition;
+import org.apache.axis2.description.OperationDescription;
+import org.apache.axis2.description.ParameterImpl;
+import org.apache.axis2.description.ServiceDescription;
+import org.apache.axis2.description.TransportInDescription;
+import org.apache.axis2.description.TransportOutDescription;
+import org.apache.axis2.engine.AxisConfigurationImpl;
 import org.apache.axis2.om.OMAbstractFactory;
+import org.apache.axis2.receivers.AbstractMessageReceiver;
 import org.apache.axis2.soap.SOAPBody;
 import org.apache.axis2.soap.SOAPEnvelope;
 import org.apache.axis2.soap.SOAPFactory;
 import org.apache.axis2.transport.local.LocalTransportReceiver;
-import org.apache.axis2.context.ConfigurationContext;
-import org.apache.axis2.context.ServiceContext;
-import org.apache.axis2.context.ServiceGroupContext;
-import org.apache.axis2.engine.AxisConfigurationImpl;
-import org.apache.axis2.description.ServiceDescription;
-import org.apache.axis2.description.ParameterImpl;
-import org.apache.axis2.description.OperationDescription;
-import org.apache.axis2.description.InOutOperationDescrition;
-import org.apache.axis2.description.TransportInDescription;
-import org.apache.axis2.description.TransportOutDescription;
-import org.apache.axis2.description.ServiceGroupDescription;
-import org.apache.axis2.receivers.AbstractMessageReceiver;
-import org.apache.axis2.clientapi.Call;
-import org.apache.axis2.addressing.EndpointReference;
-import org.apache.axis2.Constants;
 
 import javax.xml.namespace.QName;
-import javax.xml.stream.XMLOutputFactory;
-import javax.xml.stream.XMLStreamWriter;
 import java.lang.reflect.Method;
 
 /**
@@ -169,12 +164,8 @@
     }
 
     public void testRPC() throws Exception {
-/* ??? This test doesn't work when running in maven, although it works fine
-       from my IDE!  To see the problem, just uncomment the first line here: */
-
-//        Call call = new Call();
+        Call call = new Call("test-resources/xmls");
 
-/*
         // Make the SOAP envelope
         SOAPFactory factory = OMAbstractFactory.getSOAP11Factory();
         SOAPEnvelope env = factory.createSOAPEnvelope();
@@ -205,6 +196,5 @@
         for (int i = 0; i < 2; i++) {
             assertEquals("Value #" + i + " not correct!", array[i], retArray[i]);
         }
-*/
     }
 }