axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nadira...@apache.org
Subject svn commit: r393244 - in /webservices/axis/trunk/c: include/axis/ src/cbindings/ src/engine/ src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/ src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/literal/ tests/auto_build/testcases/client/c/
Date Tue, 11 Apr 2006 15:26:48 GMT
Author: nadiramra
Date: Tue Apr 11 08:26:35 2006
New Revision: 393244

URL: http://svn.apache.org/viewcvs?rev=393244&view=rev
Log:
C support fixes/enhancements.

Modified:
    webservices/axis/trunk/c/include/axis/Axis.h
    webservices/axis/trunk/c/src/cbindings/AxisC.cpp
    webservices/axis/trunk/c/src/engine/Axis.cpp
    webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/BeanParamWriter.java
    webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/ClientStubWriter.java
    webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/ParamCFileWriter.java
    webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/literal/ClientStubWriter.java
    webservices/axis/trunk/c/tests/auto_build/testcases/client/c/SimpleTypeArrayClient.c

Modified: webservices/axis/trunk/c/include/axis/Axis.h
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/include/axis/Axis.h?rev=393244&r1=393243&r2=393244&view=diff
==============================================================================
--- webservices/axis/trunk/c/include/axis/Axis.h (original)
+++ webservices/axis/trunk/c/include/axis/Axis.h Tue Apr 11 08:26:35 2006
@@ -77,14 +77,14 @@
 
 /**
   * Allocates storage to be used by Axis engine.  All proxy code and allocated
-  * storage required by the client must use this to allocate storage
-  * that may be freed by proxy code or the Axis engine.
+  * storage required by the client for basic types must use this 
+  * function in order that it may be freed by proxy code or the Axis engine.
   * 
   * @param size - size of storage to be allocated
   * @return pointer to allocated storage
   */
 AXISC_STORAGE_CLASS_INFO 
-void * axiscAxisNew(int size);
+void * axiscAxisNew(AXISC_XSDTYPE type, int size);
 
 /**
   * Registers a function that will be invoked to handle Axis engine

Modified: webservices/axis/trunk/c/src/cbindings/AxisC.cpp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/src/cbindings/AxisC.cpp?rev=393244&r1=393243&r2=393244&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/cbindings/AxisC.cpp (original)
+++ webservices/axis/trunk/c/src/cbindings/AxisC.cpp Tue Apr 11 08:26:35 2006
@@ -19,14 +19,18 @@
 
 #include <axis/Axis.hpp>
 #include <axis/AxisException.hpp>
+#include <axis/AxisUserAPI.hpp>
 
-AXIS_CPP_NAMESPACE_USE
-
-extern "C" {
+#include <axis/Axis.h>
 #include <axis/GDefine.h>
 #include <axis/AxisUserAPI.h>
+#include <axis/AxisUserAPIArrays.h>
 #include <axis/TypeMapping.h>
-#include <axis/Axis.h>
+
+
+AXIS_CPP_NAMESPACE_USE
+
+extern "C" {
 
 static AXIS_EXCEPTION_HANDLER_FUNCT global_exceptionHandler = NULL;
 
@@ -84,7 +88,84 @@
     
     try 
     {
-        Axis::AxisDelete(pValue, (XSDTYPE) type);
+	    if (pValue == NULL)
+	        return rc;
+	        
+	    // There are some types we cannot pass to C++ engine
+	    switch (type)
+	    {
+	        case XSDC_DURATION:
+	        case XSDC_DATETIME:
+	        case XSDC_TIME:
+	        case XSDC_DATE:
+	        case XSDC_GYEARMONTH:
+	        case XSDC_GYEAR:
+	        case XSDC_GMONTHDAY:
+	        case XSDC_GDAY:
+	        case XSDC_GMONTH:
+	        case XSDC_STRING:
+	        case XSDC_NORMALIZEDSTRING:
+	        case XSDC_TOKEN:
+	        case XSDC_LANGUAGE:
+	        case XSDC_NAME:
+	        case XSDC_NCNAME:
+	        case XSDC_ID:
+	        case XSDC_IDREF:
+	        case XSDC_IDREFS:
+	        case XSDC_ENTITY:
+	        case XSDC_ENTITIES:
+	        case XSDC_NMTOKEN:
+	        case XSDC_NMTOKENS:
+	        case XSDC_BOOLEAN:
+	        case XSDC_FLOAT:
+	        case XSDC_DECIMAL:
+	        case XSDC_NONPOSITIVEINTEGER:
+	        case XSDC_NEGATIVEINTEGER:
+	        case XSDC_INTEGER:
+	        case XSDC_LONG:
+	        case XSDC_INT:
+	        case XSDC_SHORT:
+	        case XSDC_BYTE:
+	        case XSDC_NONNEGATIVEINTEGER:
+	        case XSDC_UNSIGNEDLONG:
+	        case XSDC_UNSIGNEDINT:
+	        case XSDC_UNSIGNEDSHORT:
+	        case XSDC_UNSIGNEDBYTE:
+	        case XSDC_POSITIVEINTEGER:
+	        case XSDC_DOUBLE:
+	        case XSDC_ANYURI:
+	        case XSDC_QNAME:
+	        case XSDC_NOTATION:
+	        case C_USER_TYPE:
+	        case XSDC_ANY:
+	        case C_ATTACHMENT:
+	        case XSDC_UNKNOWN:
+	        {
+	            Axis::AxisDelete(pValue, (XSDTYPE) type);
+	            break;
+	        }
+	        case XSDC_ARRAY:
+	        {
+	            // TODO delete array elements if simple types
+	            delete (Axisc_Array*) pValue;
+	            break;
+	        }
+	        case XSDC_BASE64BINARY:
+	        {
+	            // TODO delete elements?	        
+	            delete (xsdc__base64Binary*) pValue;
+	            break;
+	        }
+	        case XSDC_HEXBINARY:
+	        {
+	            // TODO delete elements?	        
+	            delete (xsdc__hexBinary*) pValue;
+	            break;
+	        }
+	        
+	        default:
+	            ;
+	    }
     }
     catch ( AxisException& e  )
     {
@@ -98,6 +179,207 @@
     }    
     
     return rc;
+}
+
+
+AXISC_STORAGE_CLASS_INFO 
+void *axiscAxisNew(AXISC_XSDTYPE type, int size)
+{
+    void *retVal=NULL;
+    
+    try 
+    {	        
+	    switch (type)
+	    {
+            case XSDC_DURATION:
+            {
+                retVal = new xsd__duration();
+                break;
+            }
+            case XSDC_DATETIME:
+            {
+                retVal = new xsd__dateTime();
+                break;
+            }
+            case XSDC_TIME:
+            {
+                retVal = new xsd__time();
+                break;
+            }
+            case XSDC_DATE:
+            {
+                retVal = new xsd__date();
+                break;
+            }
+            case XSDC_GYEARMONTH:
+            {
+                retVal = new xsd__gYearMonth();
+                break;
+            }           
+            case XSDC_GYEAR:
+            {
+                retVal = new xsd__gYear();
+                break;
+            }
+            case XSDC_GMONTHDAY:
+            {
+                retVal = new xsd__gMonthDay();
+                break;
+            }
+            case XSDC_GDAY:
+            {
+                retVal = new xsd__gDay();
+                break;
+            }
+            case XSDC_GMONTH:
+            {
+                retVal = new xsd__gMonth();
+                break;
+            }
+            case XSDC_STRING:
+            case XSDC_NORMALIZEDSTRING:
+            case XSDC_TOKEN:
+            case XSDC_LANGUAGE:
+            case XSDC_NAME:
+            case XSDC_NCNAME:
+            case XSDC_ID:
+            case XSDC_IDREF:
+            case XSDC_IDREFS:
+            case XSDC_ENTITY:
+            case XSDC_ENTITIES:
+            case XSDC_NMTOKEN:
+            case XSDC_NMTOKENS:
+            case XSDC_ANYURI:
+            case XSDC_QNAME:
+            case XSDC_NOTATION:
+            {
+                retVal = new char[size+1];
+                break;
+            }
+            case XSDC_BOOLEAN:
+            {
+                retVal = new xsd__boolean();
+                break;
+            }
+            case XSDC_BASE64BINARY:
+            {
+                xsdc__base64Binary *b64bin = new xsdc__base64Binary();
+                b64bin->__size=0;
+                b64bin->__ptr=NULL;
+                retVal = b64bin;
+                break;
+            }
+            case XSDC_HEXBINARY:
+            {
+                xsdc__hexBinary *hexbin = new xsdc__hexBinary();
+                hexbin->__size=0;
+                hexbin->__ptr=NULL;
+ 				retVal = hexbin;
+                break;
+            }
+            case XSDC_FLOAT:
+            {
+                retVal = new xsd__float();
+                break;
+            }
+            case XSDC_DECIMAL:
+            {
+                retVal = new xsd__decimal();
+                break;
+            }
+            case XSDC_INTEGER:
+            {
+                retVal = new xsd__integer();
+                break;
+            }
+            case XSDC_NONPOSITIVEINTEGER:
+            {
+                retVal = new xsd__nonPositiveInteger();
+                break;
+            }
+            case XSDC_NEGATIVEINTEGER:
+            {
+                retVal = new xsd__negativeInteger();
+                break;
+            }
+            case XSDC_LONG:
+            {
+                retVal = new xsd__long();
+                break;
+            }
+            case XSDC_INT:
+            {
+                retVal = new xsd__int();
+                break;
+            }
+            case XSDC_SHORT:
+            {
+                retVal = new xsd__short();
+                break;
+            }
+            case XSDC_BYTE:
+            {
+                retVal = new xsd__byte();
+                break;
+            }
+            case XSDC_NONNEGATIVEINTEGER:
+            {
+                retVal = new xsd__nonNegativeInteger();
+                break;
+            }
+            case XSDC_UNSIGNEDLONG:
+            {
+                retVal = new xsd__unsignedLong();
+                break;
+            }
+            case XSDC_UNSIGNEDINT:
+            {
+                retVal = new xsd__unsignedInt();
+                break;
+            }
+            case XSDC_UNSIGNEDSHORT:
+            {
+                retVal = new xsd__unsignedShort();
+                break;
+            }
+            case XSDC_UNSIGNEDBYTE:
+            {
+                retVal = new xsd__unsignedByte();
+                break;
+            }
+            case XSDC_POSITIVEINTEGER:
+            {
+                retVal = new xsd__positiveInteger();
+                break;
+            }
+            case XSDC_DOUBLE:
+            {
+                retVal = new xsd__double();
+                break;
+            }
+            case XSDC_ARRAY:
+            {
+                Axisc_Array * array = new Axisc_Array();
+                array->m_Array = NULL;
+                array->m_Size  = 0;
+                array->m_Type  = XSDC_UNKNOWN;
+                retVal = array;
+                break;
+            }
+            case C_USER_TYPE:
+            case XSDC_UNKNOWN:
+            case XSDC_ANY:
+            case C_ATTACHMENT:
+            default:
+                break;
+	    }
+    }
+    catch ( ... )
+    {
+        axiscInvokeExceptionHandler(-1, "Unrecognized exception thrown.");
+    }    
+    
+    return retVal;
 }
 
 AXISC_STORAGE_CLASS_INFO 

Modified: webservices/axis/trunk/c/src/engine/Axis.cpp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/src/engine/Axis.cpp?rev=393244&r1=393243&r2=393244&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/engine/Axis.cpp (original)
+++ webservices/axis/trunk/c/src/engine/Axis.cpp Tue Apr 11 08:26:35 2006
@@ -85,6 +85,7 @@
 DeserializerPool* g_pDeserializerPool;
 SerializerPool* g_pSerializerPool;
 HandlerPool* g_pHandlerPool;
+
 // Unsynchronized read-only global variables.
 WSDDDeployment* g_pWSDDDeployment;
 AxisConfig* g_pConfig;
@@ -106,14 +107,10 @@
     // unsynchronized read-only global variables.
     g_pWSDDDeployment = new WSDDDeployment ();
 
-	if( g_pConfig != NULL)
-	{
-		g_pConfig = new AxisConfig( g_pConfig);
-	}
-	else
-	{
-		g_pConfig = new AxisConfig();
-	}
+    if( g_pConfig != NULL)
+        g_pConfig = new AxisConfig( g_pConfig);
+    else
+        g_pConfig = new AxisConfig();
 }
 
 void ModuleUnInitialize ()
@@ -126,12 +123,13 @@
     delete g_pSerializerPool;
     delete g_pHandlerPool;
     delete g_pHandlerLoader;
+    
     // unsynchronized read-only global variables.
     delete g_pWSDDDeployment;
     delete g_pConfig;
 
-	g_pConfig = NULL;
-	g_pWSDDDeployment = NULL;
+    g_pConfig = NULL;
+    g_pWSDDDeployment = NULL;
 
     AxisTrace::terminate();
 }
@@ -168,11 +166,9 @@
                      try
                      {
                         Status = engine->process(pStream);
-					   if (AXIS_SUCCESS == Status)
-						{
-							pStream->flushOutput();
-						}
-						else
+                       if (AXIS_SUCCESS == Status)
+                            pStream->flushOutput();
+                        else
                         {
                             ServerAxisEngine* pObjTempServer = (ServerAxisEngine*) engine;
                             pObjTempServer->setFaultOutputStream(Status, pStream);
@@ -193,7 +189,6 @@
                     delete engine;
                 }
             }
-          // Handle the GET method
             else if (AXIS_HTTP_GET == pStream->getSubProtocol())
             {
                 // get the uri path
@@ -279,25 +274,21 @@
                 }
                 else
                 {
-					sServiceName = g_pConfig->getAxisConfProperty(AXCONF_AXISHOME);
+                    sServiceName = g_pConfig->getAxisConfProperty(AXCONF_AXISHOME);
                     sServiceName += WSDLDIRECTORY + sUriWOAxis + ".wsdl";
                     // Check whether wsdl file is available
                     if ((WsddFile = fopen (sServiceName.c_str (), "r")) == NULL)
                     {
-                        pStream->sendBytes("<h3>Url not available</h3>",
-                            NULL);
+                        pStream->sendBytes("<h3>Url not available</h3>", NULL);
                         Status = AXIS_SUCCESS;
-                        // Handle the error
                     }
                     else
                     {
                         int charcount = 0;
-                        while ((charcount = fread (ReadBuffer, 1,
-                            BYTESTOREAD - 1, WsddFile)) != 0)
+                        while ((charcount = fread (ReadBuffer, 1, BYTESTOREAD - 1, WsddFile))
!= 0)
                         {
                             *(ReadBuffer + charcount) = '\0';
-                            pStream->sendBytes(ReadBuffer,
-                                NULL);
+                            pStream->sendBytes(ReadBuffer, NULL);
                         }
                         Status = AXIS_SUCCESS;
                         fclose (WsddFile);
@@ -305,7 +296,7 @@
                 }
             }
             
-	    break;
+        break;
 
         default:
             pStream->sendBytes("Unknown Protocol", NULL);
@@ -373,16 +364,16 @@
 
             if (bServer) // no client side wsdd processing at the moment
             {
-    		    // Read from the configuration file
+                // Read from the configuration file
                 status = g_pConfig->readConfFile (); 
 
                 if (status == AXIS_SUCCESS)
-                {					
-					try
-					{            
-						XMLParserFactory::initialize();
-					}
-					catch (AxisException& e)
+                {                    
+                    try
+                    {            
+                        XMLParserFactory::initialize();
+                    }
+                    catch (AxisException& e)
                     {
                         throw AxisEngineException(e.getExceptionCode(), e.what());
                     }
@@ -399,9 +390,7 @@
                     try
                     {            
                         if (AXIS_SUCCESS != g_pWSDDDeployment->loadWSDD (pWsddPath))
-                        {
                             status = AXIS_FAIL;
-                        }
                     }
                     catch (AxisException& e)
                     {
@@ -409,9 +398,7 @@
                     }
                 }
                 else
-                {
                     status = AXIS_FAIL;
-                }
            }
            else if (bServer == 0)      // client side module initialization
            {
@@ -425,22 +412,18 @@
                    XMLParserFactory::initialize();
                    SOAPTransportFactory::initialize();
 
-                   char *	pClientWsddPath = g_pConfig->getAxisConfProperty(AXCONF_CLIENTWSDDFILEPATH);
+                   char *    pClientWsddPath = g_pConfig->getAxisConfProperty(AXCONF_CLIENTWSDDFILEPATH);
     
-// May be there is no client side handlers configured. So may not have CLIENTWSDDFILEPATH
entry in axiscpp.conf 
+                   // May be there is no client side handlers configured. So may not have
CLIENTWSDDFILEPATH entry in axiscpp.conf 
                    if (pClientWsddPath)
-                   {
                        if (AXIS_SUCCESS != g_pWSDDDeployment->loadWSDD (pClientWsddPath))
-                       {
                            status = AXIS_FAIL;
-                       }
-                   }
                 }
                 else
                 {
                     AXISTRACE3( "Reading from the configuration file failed. \
-								Check for error in the configuration file.\n\
-								Handlers and logging are not working");
+                                Check for error in the configuration file.\n\
+                                Handlers and logging are not working");
                     /* TODO:Improve the AxisTrace so that it will log these kind of 
                      * messages into a log file according to the critical level 
                      * specified.
@@ -455,7 +438,7 @@
        }
        else if (AxisEngine::m_bServer != bServer)
        {
-		   throw AxisEngineException(SERVER_ENGINE_EXCEPTION);
+           throw AxisEngineException(SERVER_ENGINE_EXCEPTION);
        }
     }
     catch (...)
@@ -531,288 +514,243 @@
 
 void Axis::AxisDelete(void *pValue, XSDTYPE type)
 {
-    if (pValue != NULL)
+    if (pValue == NULL)
+        return;
+        
+    switch (type)
     {
-        switch (type)
+        case XSD_DURATION:
         {
-            case XSD_DURATION:
-            {
-                delete (xsd__duration*) pValue;
-                pValue = NULL;
-    			break;
-            }
-            case XSD_DATETIME:
-            {
-                delete (xsd__dateTime*) pValue;
-                pValue = NULL;
-                break;
-            }
-            case XSD_TIME:
-            {
-                delete (xsd__time*) pValue;
-                pValue = NULL;
-                break;
-            }
-            case XSD_DATE:
-            {
-                delete (xsd__date*) pValue;
-                pValue = NULL;
-                break;
-            }
-            case XSD_GYEARMONTH:
-            {
-                delete (xsd__gYearMonth*) pValue;
-                pValue = NULL;
-                break;
-            }
-            case XSD_GYEAR:
-            {
-                delete (xsd__gYear*) pValue;
-                pValue = NULL;
-                break;
-            }
-            case XSD_GMONTHDAY:
-            {
-                delete (xsd__gMonthDay*) pValue;
-                pValue = NULL;
-                break;
-            }
-            case XSD_GDAY:
-            {
-                delete (xsd__gDay*) pValue;
-                pValue = NULL;
-                break;
-            }
-            case XSD_GMONTH:
-            {
-                delete (xsd__gMonth*) pValue;
-                pValue = NULL;
-                break;
-            }
-            case XSD_STRING:
-            {
-                delete [] (xsd__string) pValue;
-                pValue = NULL;
-                break;
-            }
-            case XSD_NORMALIZEDSTRING:
-            {
-                delete [] (xsd__normalizedString) pValue;
-                pValue = NULL;
-                break;
-            }
-            case XSD_TOKEN:
-            {
-                delete [] (xsd__token) pValue;
-                pValue = NULL;
-                break;
-            }
-            case XSD_LANGUAGE:
-            {
-                delete [] (xsd__language) pValue;
-                pValue = NULL;
-                break;
-            }
-            case XSD_NAME:
-            {
-                delete [] (xsd__Name) pValue;
-                pValue = NULL;
-                break;
-            }
-            case XSD_NCNAME:
-            {
-                delete [] (xsd__NCName) pValue;
-                pValue = NULL;
-                break;
-            }
-            case XSD_ID:
-            {
-                delete [] (xsd__ID) pValue;
-                pValue = NULL;
-                break;
-            }
-            case XSD_IDREF:
-            {
-                delete [] (xsd__IDREF) pValue;
-                pValue = NULL;
-                break;
-            }
-            case XSD_IDREFS:
-            {
-                delete [] (xsd__IDREFS) pValue;
-                pValue = NULL;
-                break;
-            }
-            case XSD_ENTITY:
-            {
-                delete [] (xsd__ENTITY) pValue;
-                pValue = NULL;
-                break;
-            }
-            case XSD_ENTITIES:
-            {
-                delete [] (xsd__ENTITIES) pValue;
-                pValue = NULL;
-                break;
-            }
-            case XSD_NMTOKEN:
-            {
-                delete [] (xsd__NMTOKEN) pValue;
-                pValue = NULL;
-                break;
-            }
-            case XSD_NMTOKENS:
-            {
-                delete [] (xsd__NMTOKENS) pValue;
-                pValue = NULL;
-                break;
-            }
-            case XSD_BOOLEAN:
-            {
-                delete (xsd__boolean*) pValue;
-                pValue = NULL;
-                break;
-            }
-            case XSD_BASE64BINARY:
-            {
-                delete (xsd__base64Binary*) pValue;
-                pValue = NULL;
-                break;
-            }
-            case XSD_HEXBINARY:
-            {
-                delete (xsd__hexBinary*) pValue;
-                pValue = NULL;
-                break;
-            }
-            case XSD_FLOAT:
-            {
-                delete (xsd__float*) pValue;
-                pValue = NULL;
-                break;
-            }
-            case XSD_DECIMAL:
-            {
-                delete (xsd__decimal*) pValue;
-                pValue = NULL;
-                break;
-            }
-            case XSD_NONPOSITIVEINTEGER:
-            {
-                delete (xsd__nonPositiveInteger*) pValue;
-                pValue = NULL;
-                break;
-            }
-            case XSD_NEGATIVEINTEGER:
-            {
-                delete (xsd__negativeInteger*) pValue;
-                pValue = NULL;
-                break;
-            }
-            case XSD_INTEGER:
-            {
-                delete (xsd__integer*) pValue;
-                pValue = NULL;
-                break;
-            }
-            case XSD_LONG:
-            {
-                delete (xsd__long*) pValue;
-                pValue = NULL;
-                break;
-            }
-            case XSD_INT:
-            {
-                delete (xsd__int*) pValue;
-                pValue = NULL;
-                break;
-            }
-            case XSD_SHORT:
-            {
-                delete (xsd__short*) pValue;
-                pValue = NULL;
-                break;
-            }
-            case XSD_BYTE:
-            {
-                delete (xsd__byte*) pValue;
-                pValue = NULL;
-                break;
-            }
-            case XSD_NONNEGATIVEINTEGER:
-            {
-                delete (xsd__nonNegativeInteger*) pValue;
-                pValue = NULL;
-                break;
-            }
-            case XSD_UNSIGNEDLONG:
-            {
-                delete (xsd__unsignedLong*) pValue;
-                pValue = NULL;
-                break;
-            }
-            case XSD_UNSIGNEDINT:
-            {
-                delete (xsd__unsignedInt*) pValue;
-                pValue = NULL;
-                break;
-            }
-            case XSD_UNSIGNEDSHORT:
-            {
-                delete (xsd__unsignedShort*) pValue;
-                pValue = NULL;
-                break;
-            }
-            case XSD_UNSIGNEDBYTE:
-            {
-                delete (xsd__unsignedByte*) pValue;
-                pValue = NULL;
-                break;
-            }
-            case XSD_POSITIVEINTEGER:
-            {
-                delete (xsd__positiveInteger*) pValue;
-                pValue = NULL;
-                break;
-            }
-            case XSD_DOUBLE:
-            {
-                delete (xsd__double*) pValue;
-                pValue = NULL;
-                break;
-            }
-            case XSD_ANYURI:
-            {
-                delete [] (xsd__anyURI) pValue;
-                pValue = NULL;
-                break;
-            }
-            case XSD_QNAME:
-            {
-                delete [] (xsd__QName) pValue;
-                pValue = NULL;
-                break;
-            }
-            case XSD_NOTATION:
-            {
-                delete [] (xsd__NOTATION) pValue;
-                pValue = NULL;
-                break;
-            }
-            case USER_TYPE:
-                // The USER_TYPE object should be cleared by the Application
-                break;
-            case XSD_ARRAY:
-            {
-                delete (Axis_Array*) pValue;
-                pValue = NULL;
-                break;
-            }
-            case XSD_ANY:
-            case ATTACHMENT:
-            case XSD_UNKNOWN:
-            default:
-    			;
+            delete (xsd__duration*) pValue;
+            break;
         }
+        case XSD_DATETIME:
+        {
+            delete (xsd__dateTime*) pValue;
+            break;
+        }
+        case XSD_TIME:
+        {
+            delete (xsd__time*) pValue;
+            break;
+        }
+        case XSD_DATE:
+        {
+            delete (xsd__date*) pValue;
+            break;
+        }
+        case XSD_GYEARMONTH:
+        {
+            delete (xsd__gYearMonth*) pValue;
+            break;
+        }
+        case XSD_GYEAR:
+        {
+            delete (xsd__gYear*) pValue;
+            break;
+        }
+        case XSD_GMONTHDAY:
+        {
+            delete (xsd__gMonthDay*) pValue;
+            break;
+        }
+        case XSD_GDAY:
+        {
+            delete (xsd__gDay*) pValue;
+            break;
+        }
+        case XSD_GMONTH:
+        {
+            delete (xsd__gMonth*) pValue;
+            break;
+        }
+        case XSD_STRING:
+        {
+            delete [] (xsd__string) pValue;
+            break;
+        }
+        case XSD_NORMALIZEDSTRING:
+        {
+            delete [] (xsd__normalizedString) pValue;
+            break;
+        }
+        case XSD_TOKEN:
+        {
+            delete [] (xsd__token) pValue;
+            break;
+        }
+        case XSD_LANGUAGE:
+        {
+            delete [] (xsd__language) pValue;
+            break;
+        }
+        case XSD_NAME:
+        {
+            delete [] (xsd__Name) pValue;
+            break;
+        }
+        case XSD_NCNAME:
+        {
+            delete [] (xsd__NCName) pValue;
+            break;
+        }
+        case XSD_ID:
+        {
+            delete [] (xsd__ID) pValue;
+            break;
+        }
+        case XSD_IDREF:
+        {
+            delete [] (xsd__IDREF) pValue;
+            break;
+        }
+        case XSD_IDREFS:
+        {
+            delete [] (xsd__IDREFS) pValue;
+            break;
+        }
+        case XSD_ENTITY:
+        {
+            delete [] (xsd__ENTITY) pValue;
+            break;
+        }
+        case XSD_ENTITIES:
+        {
+            delete [] (xsd__ENTITIES) pValue;
+            break;
+        }
+        case XSD_NMTOKEN:
+        {
+            delete [] (xsd__NMTOKEN) pValue;
+            break;
+        }
+        case XSD_NMTOKENS:
+        {
+            delete [] (xsd__NMTOKENS) pValue;
+            break;
+        }
+        case XSD_BOOLEAN:
+        {
+            delete (xsd__boolean*) pValue;
+            break;
+        }
+        case XSD_BASE64BINARY:
+        {
+            delete (xsd__base64Binary*) pValue;
+            break;
+        }
+        case XSD_HEXBINARY:
+        {
+            delete (xsd__hexBinary*) pValue;
+            break;
+        }
+        case XSD_FLOAT:
+        {
+            delete (xsd__float*) pValue;
+            break;
+        }
+        case XSD_DECIMAL:
+        {
+            delete (xsd__decimal*) pValue;
+            break;
+        }
+        case XSD_NONPOSITIVEINTEGER:
+        {
+            delete (xsd__nonPositiveInteger*) pValue;
+            break;
+        }
+        case XSD_NEGATIVEINTEGER:
+        {
+            delete (xsd__negativeInteger*) pValue;
+            break;
+        }
+        case XSD_INTEGER:
+        {
+            delete (xsd__integer*) pValue;
+            break;
+        }
+        case XSD_LONG:
+        {
+            delete (xsd__long*) pValue;
+            break;
+        }
+        case XSD_INT:
+        {
+            delete (xsd__int*) pValue;
+            break;
+        }
+        case XSD_SHORT:
+        {
+            delete (xsd__short*) pValue;
+            break;
+        }
+        case XSD_BYTE:
+        {
+            delete (xsd__byte*) pValue;
+            break;
+        }
+        case XSD_NONNEGATIVEINTEGER:
+        {
+            delete (xsd__nonNegativeInteger*) pValue;
+            break;
+        }
+        case XSD_UNSIGNEDLONG:
+        {
+            delete (xsd__unsignedLong*) pValue;
+            break;
+        }
+        case XSD_UNSIGNEDINT:
+        {
+            delete (xsd__unsignedInt*) pValue;
+            break;
+        }
+        case XSD_UNSIGNEDSHORT:
+        {
+            delete (xsd__unsignedShort*) pValue;
+            break;
+        }
+        case XSD_UNSIGNEDBYTE:
+        {
+            delete (xsd__unsignedByte*) pValue;
+            break;
+        }
+        case XSD_POSITIVEINTEGER:
+        {
+            delete (xsd__positiveInteger*) pValue;
+            break;
+        }
+        case XSD_DOUBLE:
+        {
+            delete (xsd__double*) pValue;
+            break;
+        }
+        case XSD_ANYURI:
+        {
+            delete [] (xsd__anyURI) pValue;
+            break;
+        }
+        case XSD_QNAME:
+        {
+            delete [] (xsd__QName) pValue;
+            break;
+        }
+        case XSD_NOTATION:
+        {
+            delete [] (xsd__NOTATION) pValue;
+            break;
+        }
+        case USER_TYPE:
+            // The USER_TYPE object should be cleared by the Application
+            break;
+        case XSD_ARRAY:
+        {
+            delete (Axis_Array*) pValue;
+            break;
+        }
+        case XSD_ANY:
+        case ATTACHMENT:
+        case XSD_UNKNOWN:
+        default:
+            ;
     }
 }

Modified: webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/BeanParamWriter.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/BeanParamWriter.java?rev=393244&r1=393243&r2=393244&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/BeanParamWriter.java
(original)
+++ webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/BeanParamWriter.java
Tue Apr 11 08:26:35 2006
@@ -130,7 +130,7 @@
         writer.write("\tAxiscBool blnIsNewPrefix = xsdc_boolean_false;\n\n");
         
         writer.write("\tif ( param == NULL )\n\t{\n");
-        writer.write("\t\taxiscSerializeAsAttribute(pSZ, \"xsi:nil\", 0, (void*)&(xsdc_boolean_true),
XSD_BOOLEAN);\n");
+        writer.write("\t\taxiscSerializeAsAttribute(pSZ, \"xsi:nil\", 0, (void*)&(xsdc_boolean_true),
XSDC_BOOLEAN);\n");
         writer.write("\t\taxiscSerializeIWrapperSoapSerializer(pSZ, \">\", NULL);\n");
         writer.write("\t\treturn AXISC_SUCCESS;\n");
         writer.write("\t}\n\n");
@@ -479,15 +479,23 @@
                         baseTypeName = CUtils.getclass4qname(attribs[i].getType().getBaseType());
                     else
                         baseTypeName = attribs[i].getTypeName();
+
+                    writer.write("\t/* If there is an existing array, delete it */\n");
+                    writer.write("\tif (param->" + attribs[i].getParamNameAsMember() +
" != NULL)\n");
+                    writer.write("\t{\n");
+                    writer.write("\t\taxiscAxisDelete(param->" + attribs[i].getParamNameAsMember()
+ ", XSDC_ARRAY);\n");
+                    writer.write("\t\tparam->" + attribs[i].getParamNameAsMember() + "=
NULL;\n");
+                    writer.write("\t}\n");
+                    writer.write("\n");
                     
-                    writer.write("\tAxisc_Array *array" + arrayCount + "= axiscGetBasicArrayIWrapperSoapDeSerializer(pDZ,
" 
+                    writer.write("\t/* Deserialize array */\n");
+                    writer.write("\tparam->" + attribs[i].getParamNameAsMember() 
+                            + " = (" + baseTypeName + "_Array *)" 
+                            + "axiscGetBasicArrayIWrapperSoapDeSerializer(pDZ, " 
                             + CUtils.getXSDTypeForBasicType(baseTypeName) + ", \"" 
-                            + attribs[i].getParamNameAsSOAPElement()
-                            + "\",0);\n");
-      
-                    writer.write("\tparam->" + attribs[i].getParamNameAsMember() + " =
array" + arrayCount + "->m_Array;\n");
-              
-                    // TODO C-BINDING MEMORY MANAGEMENT?
+                            + attribs[i].getParamNameAsSOAPElement() + "\",0);\n");
+
+                    writer.write("\n");
                 }
                 else
                 {
@@ -678,6 +686,7 @@
                     + CUtils.getXSDTypeForBasicType(extensionBaseAttrib.getTypeName()) +
");\n");
         }
         
+        writer.write("\t/* Return deserialization status */\n");
         writer.write("\treturn axiscGetStatusIWrapperSoapDeSerializer(pDZ);\n");
         writer.write("}\n");
     }
@@ -722,21 +731,29 @@
 
         writer.write("void Axis_Delete_" + classname
                 + "(" + classname + "* param, AxiscBool bArray, int nSize)\n");
+        
         writer.write("{\n");
-        writer.write("\tif (!param) return;\n\n");
+        writer.write("\t/* If NULL, just return */\n");
+        writer.write("\tif (!param)\n");
+        writer.write("\t\treturn;\n");
+        writer.write("\n");
+        
+        writer.write("\t/* Recursion is used to delete arrays */\n");
         writer.write("\tif (bArray)\n");
         writer.write("\t{\n");
         writer.write("\t\tif (nSize > 0)\n");
         writer.write("\t\t{\n");
         writer.write("\t\t\tint count;\n");
+        writer.write("\t\t\t" + classname + " **paramArray = (" + classname + " **)param;\n");
         writer.write("\t\t\tfor (count = 0 ; count < nSize ; count++ )\n");
         writer.write("\t\t\t{\n");
-        writer.write("\t\t\t\tif ( (( " + classname + " ** ) param)[count])\n");
+        writer.write("\t\t\t\tif (paramArray[count])\n");
         writer.write("\t\t\t\t{\n");
-        writer.write("\t\t\t\t\tfree ((( " + classname + " ** ) param)[count]);\n");
+        writer.write("\t\t\t\t\tAxis_Delete_" + classname + "(paramArray[count],0,0);\n");
+        writer.write("\t\t\t\t\tparamArray[count] = NULL;\n");
         writer.write("\t\t\t\t}\n");
         writer.write("\t\t\t}\n");
-        writer.write("\t\t\tfree(( " + classname + " ** ) param);\n");
+        writer.write("\t\t\tfree(param);\n");
         writer.write("\t\t}\n");
         writer.write("\t}\n");
         writer.write("\telse\n");
@@ -749,13 +766,6 @@
 // Following will need to be used above....
 //    private void writeDeleteGlobalMethod() throws IOException
 //    {
-//        writer.write("/**\n");
-//        writer.write(" * This static method to deallocate a " + classname + " type of object\n");
-//        writer.write(" */\n");
-//
-//        writer.write(
-//            "void Axis_Delete_" + classname + "(" + classname + "* param, AxiscBool bArray,
int nSize)\n");
-//        writer.write("{\n");
 //        boolean hasComplexTypeOrArray = false;
 //        for (int i = 0; i < attribs.length; i++)
 //        {

Modified: webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/ClientStubWriter.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/ClientStubWriter.java?rev=393244&r1=393243&r2=393244&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/ClientStubWriter.java
(original)
+++ webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/ClientStubWriter.java
Tue Apr 11 08:26:35 2006
@@ -267,7 +267,7 @@
             if (returntypeisarray)
             {
                 //for arrays
-                writer.write(outparamTypeName + " RetArray = {NULL, 0, XSD_UNKNOWN};\n");
+                writer.write(outparamTypeName + " RetArray = {NULL, 0, XSDC_UNKNOWN};\n");
             }
             else
                 if (!returntypeissimple)

Modified: webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/ParamCFileWriter.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/ParamCFileWriter.java?rev=393244&r1=393243&r2=393244&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/ParamCFileWriter.java
(original)
+++ webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/ParamCFileWriter.java
Tue Apr 11 08:26:35 2006
@@ -117,7 +117,7 @@
         try
         {
             writer.write("#include <stdlib.h>\n");
-            writer.write("#include <memory.h>\n");
+            writer.write("#include <string.h>\n");
             writer.write("\n");
 
             writer.write("#include <axis/Axis.h>\n");

Modified: webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/literal/ClientStubWriter.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/literal/ClientStubWriter.java?rev=393244&r1=393243&r2=393244&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/literal/ClientStubWriter.java
(original)
+++ webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/literal/ClientStubWriter.java
Tue Apr 11 08:26:35 2006
@@ -211,7 +211,7 @@
         {
             writer.write("\t");
             if (returntypeisarray)
-                writer.write(outparamType + " RetArray = {NULL, 0, XSD_UNKNOWN};\n");
+                writer.write(outparamType + " RetArray = {NULL, 0, XSDC_UNKNOWN};\n");
             else if (!returntypeissimple)
             {
                 // for AnyType and complex types

Modified: webservices/axis/trunk/c/tests/auto_build/testcases/client/c/SimpleTypeArrayClient.c
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/client/c/SimpleTypeArrayClient.c?rev=393244&r1=393243&r2=393244&view=diff
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/client/c/SimpleTypeArrayClient.c (original)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/client/c/SimpleTypeArrayClient.c Tue
Apr 11 08:26:35 2006
@@ -46,7 +46,7 @@
     
     array_input.m_Array = array;
     array_input.m_Size  = 100;
-    array_input.m_Type  = XSD_INT;
+    array_input.m_Type  = XSDC_INT;
 
     input = Axis_Create_Type(0,0,0);
     input->item = &array_input;
@@ -62,10 +62,11 @@
     {
        returnValue = 0;
        for ( i = 0; i < 100; i++ )
-         printf ("item [%d] = %d\n",i,output->item->m_Array[i]);
+         printf ("item [%d] = %d\n",i,*output->item->m_Array[i]);
     }
     
     input->item = NULL;
+    
     Axis_Delete_Type(input,0,0);
     Axis_Delete_Type(output,0,0);
     



Mime
View raw message