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 na...@apache.org on 2006/05/09 19:58:54 UTC

svn commit: r405487 - in /webservices/axis/trunk/c/tests/auto_build/testcases: client/c/ client/cpp/ tests/

Author: nadiramra
Date: Tue May  9 10:58:51 2006
New Revision: 405487

URL: http://svn.apache.org/viewcvs?rev=405487&view=rev
Log:
C support fixes/enhancements. Testcases for C bindings.

Added:
    webservices/axis/trunk/c/tests/auto_build/testcases/client/c/XSD_base64BinaryClient.c
    webservices/axis/trunk/c/tests/auto_build/testcases/client/c/XSD_hexBinaryClient.c
    webservices/axis/trunk/c/tests/auto_build/testcases/tests/XSD_base64BinaryC.xml
    webservices/axis/trunk/c/tests/auto_build/testcases/tests/XSD_hexBinaryC.xml
Modified:
    webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_base64BinaryClient.cpp
    webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_hexBinaryClient.cpp

Added: webservices/axis/trunk/c/tests/auto_build/testcases/client/c/XSD_base64BinaryClient.c
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/client/c/XSD_base64BinaryClient.c?rev=405487&view=auto
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/client/c/XSD_base64BinaryClient.c (added)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/client/c/XSD_base64BinaryClient.c Tue May  9 10:58:51 2006
@@ -0,0 +1,136 @@
+// Copyright 2003-2004 The Apache Software Foundation.
+// (c) Copyright IBM Corp. 2004, 2005 All Rights Reserved
+// 
+// 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.
+
+#include <stdlib.h>
+#include <stdio.h>
+
+#include "CommonClientTestCode.h"
+#include "XSD_base64Binary.h"
+
+
+int main(int argc, char* argv[])
+{
+    AXISCHANDLE ws;
+    
+    xsdc__base64Binary input;
+    xsdc__base64Binary result;
+    xsdc__base64Binary* nillableResult;
+    
+    xsdc__unsignedByte* testUB;  
+    
+    char endpoint[256];
+    const char* url="http://localhost:80/axis/XSD_base64Binary";
+
+    if(argc>1)
+        url = argv[1];
+
+    sprintf(endpoint, "%s", url);
+    ws = get_XSD_base64Binary_stub(endpoint);
+
+    testUB = (xsdc__unsignedByte*)stringToAscii("<test><xml>some dod&y string</xml></test>\n");
+    input.__ptr = testUB;
+    input.__size= 41;
+
+    // Test non-nillable element
+    result = asNonNillableElement(ws, input);
+    printf( "non-nillable element\n" );
+    printf( " size=%d\n" , result.__size );
+    printf( " data=%s\n" , asciiToStringOfLength((char *)result.__ptr, result.__size) );
+
+    // Test nillable element, with a value
+    nillableResult = asNillableElement(ws, &input);
+    if (nillableResult)
+    {
+        printf( "nillable element\n" );
+        printf( " size=%d\n" , nillableResult->__size );
+        printf( " data=%s\n" , asciiToStringOfLength((char *)nillableResult->__ptr, nillableResult->__size) );
+        axiscAxisDelete(nillableResult, XSDC_BASE64BINARY);
+    }
+    else
+        printf( "nillable element=<nil>\n" );
+
+    // Test nillable element, with nil
+    nillableResult = asNillableElement(ws, NULL);
+    if (nillableResult)
+    {
+        printf( "nillable element" );
+        printf( " size=%d\n" , nillableResult->__size );
+        printf( " data=%s\n" , asciiToStringOfLength((char *)nillableResult->__ptr, nillableResult->__size) );
+        axiscAxisDelete(nillableResult, XSDC_BASE64BINARY);
+    }
+    else
+        printf( "nil element=<nil>\n" );
+
+    // Test array
+    {
+#define ARRAY_SIZE 2                    
+        int i, outputSize=0;
+        
+        xsdc__base64Binary_Array arrayInput;
+        xsdc__base64Binary_Array* arrayResult;
+        xsdc__base64Binary *array[ARRAY_SIZE];
+        xsdc__base64Binary **output;
+        
+        for (i=0 ; i < ARRAY_SIZE ; i++)
+            array[i] = &input;
+                           
+        arrayInput.m_Array = array;
+        arrayInput.m_Size  = ARRAY_SIZE;
+        arrayInput.m_Type  = XSDC_BASE64BINARY;
+        
+        arrayResult = asArray(ws, &arrayInput);
+
+        if (arrayResult)
+        {
+           output     = arrayResult->m_Array;
+           outputSize = arrayResult->m_Size;
+        }
+    
+        printf("array of %d elements\n" , outputSize );   
+
+        for (i = 0; i < outputSize ; i++)
+        {
+            printf( " element[%d]\n" , i);
+            printf( "  size=%d\n" , output[i]->__size );
+            printf( "  data=%s\n" , asciiToStringOfLength((char *) output[i]->__ptr, output[i]->__size) );
+        }
+
+        axiscAxisDelete(arrayResult, XSDC_ARRAY);
+    }
+
+    // Test complex type
+    {
+        SimpleComplexType complexTypeInput;
+        SimpleComplexType* complexTypeResult;
+        
+        complexTypeInput.complexTypeElement = input;
+        complexTypeResult = asComplexType(ws, &complexTypeInput);
+        printf( "within complex type\n" );
+        printf( " size=%d\n" , complexTypeResult->complexTypeElement.__size );
+        printf( " data=%s\n" , 
+                asciiToStringOfLength((char *)complexTypeResult->complexTypeElement.__ptr, 
+                                      complexTypeResult->complexTypeElement.__size) );
+        Axis_Delete_SimpleComplexType(complexTypeResult, 0);
+    }
+
+    // Tests now complete
+
+    destroy_XSD_base64Binary_stub(ws);
+
+    printf("---------------------- TEST COMPLETE -----------------------------\n");
+
+    return 0;
+}
+

Added: webservices/axis/trunk/c/tests/auto_build/testcases/client/c/XSD_hexBinaryClient.c
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/client/c/XSD_hexBinaryClient.c?rev=405487&view=auto
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/client/c/XSD_hexBinaryClient.c (added)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/client/c/XSD_hexBinaryClient.c Tue May  9 10:58:51 2006
@@ -0,0 +1,140 @@
+// Copyright 2003-2004 The Apache Software Foundation.
+// (c) Copyright IBM Corp. 2004, 2005 All Rights Reserved
+// 
+// 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.
+
+#include <stdlib.h>
+#include <stdio.h>
+
+#include "CommonClientTestCode.h"
+#include "XSD_hexBinary.h"
+
+
+
+int main(int argc, char* argv[])
+{
+    AXISCHANDLE ws;
+    
+    xsdc__hexBinary input;
+    xsdc__hexBinary result;
+    xsdc__hexBinary* nillableResult;
+    
+    xsdc__unsignedByte* testUB;  
+    
+    char endpoint[256];
+    const char* url="http://localhost:80/axis/XSD_hexBinary";
+
+    if(argc>1)
+        url = argv[1];
+
+    sprintf(endpoint, "%s", url);
+    ws = get_XSD_hexBinary_stub(endpoint);       
+
+    testUB = (xsdc__unsignedByte*)stringToAscii("<test><xml>some dod&y string</xml></test>\n");
+    input.__ptr = testUB;
+    input.__size= 41;
+
+
+    // Test non-nillable element
+    result = asNonNillableElement(ws, input);
+    printf( "non-nillable element\n" );
+    printf( " size=%d\n" , result.__size );
+    printf( " data=%s\n" , asciiToStringOfLength((char *)result.__ptr, result.__size) );
+
+    // Test nillable element, with a value
+    nillableResult = asNillableElement(ws, &input);
+    if (nillableResult)
+    {
+        printf( "nillable element\n" );
+        printf( " size=%d\n" , nillableResult->__size );
+        printf( " data=%s\n" , asciiToStringOfLength((char *)nillableResult->__ptr, nillableResult->__size) );
+
+        axiscAxisDelete(nillableResult, XSDC_HEXBINARY);
+    }
+    else
+        printf( "nillable element=<nil>\n" );
+
+    // Test nillable element, with nil
+    nillableResult = asNillableElement(ws, NULL);
+    if (nillableResult)
+    {
+        printf( "nillable element\n" );
+        printf( " size=%d\n" , nillableResult->__size );
+        printf( " data=%s\n" , asciiToStringOfLength((char *)nillableResult->__ptr, nillableResult->__size) );
+
+        axiscAxisDelete(nillableResult, XSDC_HEXBINARY);
+    }
+    else
+        printf( "nil element=<nil>\n" );
+
+    // Test array
+    {
+#define ARRAY_SIZE 2                    
+        int i, outputSize=0;
+        
+        xsdc__hexBinary_Array arrayInput;
+        xsdc__hexBinary_Array* arrayResult;
+        xsdc__hexBinary * array[ARRAY_SIZE];
+        xsdc__hexBinary ** output;
+        
+        for (i=0 ; i < ARRAY_SIZE ; i++)
+            array[i] = &input;            
+               
+        arrayInput.m_Array = array;
+        arrayInput.m_Size  = ARRAY_SIZE;
+        arrayInput.m_Type  = XSDC_HEXBINARY;
+        
+        arrayResult = asArray(ws, &arrayInput);
+
+        if (arrayResult)
+        {
+           output     = arrayResult->m_Array;
+           outputSize = arrayResult->m_Size;
+        }
+    
+        printf("array of %d elements\n" , outputSize );   
+
+        for (i = 0; i < outputSize; i++)
+        {
+            printf( " element[%d]\n" , i);
+            printf( "  size=%d\n" , output[i]->__size );
+            printf( "  data=%s\n" , asciiToStringOfLength((char *) output[i]->__ptr, output[i]->__size) );           
+        }
+
+        axiscAxisDelete(arrayResult, XSDC_ARRAY);
+    }
+
+
+    // Test complex type
+    {
+        SimpleComplexType complexTypeInput;
+        SimpleComplexType* complexTypeResult;
+        
+        complexTypeInput.complexTypeElement = input;
+        complexTypeResult = asComplexType(ws, &complexTypeInput);
+        printf( "within complex type\n" );
+        printf( " size=%d\n" , complexTypeResult->complexTypeElement.__size );
+        printf( " data=%s\n" , 
+                asciiToStringOfLength((char *)complexTypeResult->complexTypeElement.__ptr, 
+                                      complexTypeResult->complexTypeElement.__size) );
+
+        Axis_Delete_SimpleComplexType(complexTypeResult, 0);
+    }
+
+    // Tests now complete
+    destroy_XSD_hexBinary_stub(ws);
+
+    printf( "---------------------- TEST COMPLETE -----------------------------\n");
+   
+    return 0;
+}

Modified: webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_base64BinaryClient.cpp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_base64BinaryClient.cpp?rev=405487&r1=405486&r2=405487&view=diff
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_base64BinaryClient.cpp (original)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_base64BinaryClient.cpp Tue May  9 10:58:51 2006
@@ -13,6 +13,15 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
+/* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! */
+/* NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE   */
+/* ----------------------------------------------------------------   */
+/* CHANGES TO THIS FILE MAY ALSO REQUIRE CHANGES TO THE               */
+/* C-EQUIVALENT FILE. PLEASE ENSURE THAT IT IS DONE.                  */
+/* ----------------------------------------------------------------   */
+/* NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE   */
+/* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! */
+
 
 #include "XSD_base64Binary.hpp"
 #include <axis/AxisException.hpp>
@@ -23,128 +32,128 @@
 
 int main(int argc, char* argv[])
 {
-        char endpoint[256];
-        const char* url="http://localhost:80/axis/XSD_base64Binary";
-
-        if(argc>1)
-                url = argv[1];
-
-                // bool bSuccess = false;
-
-        try
-        {
-                sprintf(endpoint, "%s", url);
-                XSD_base64Binary* ws = new XSD_base64Binary(endpoint);
-
-        xsd__base64Binary input;
-
-        xsd__unsignedByte* testUB = (xsd__unsignedByte*)stringToAscii("<test><xml>some dod&y string</xml></test>");
+    XSD_base64Binary* ws;
+    
+    xsd__base64Binary input;
+    xsd__base64Binary result;
+    xsd__base64Binary* nillableResult;
+    
+    xsd__unsignedByte* testUB;
+    
+    int size = 0;
+    const xsd__unsignedByte * resultData;   
+    
+    char endpoint[256];
+    const char* url="http://localhost:80/axis/XSD_base64Binary";
+
+    if(argc>1)
+        url = argv[1];
+
+    try
+    {
+        sprintf(endpoint, "%s", url);
+        ws = new XSD_base64Binary(endpoint);
 
+        testUB = (xsd__unsignedByte*)stringToAscii("<test><xml>some dod&y string</xml></test>");
         input.set(testUB, 41);
 
-                // Test non-nillable element
-            xsd__base64Binary result = ws->asNonNillableElement(input);
-        int size = 0;
-        const xsd__unsignedByte * resultData = result.get(size);
-                cout << "non-nillable element" << endl;
+        // Test non-nillable element
+        result = ws->asNonNillableElement(input);
+        resultData = result.get(size);
+        
+        cout << "non-nillable element" << endl;
         cout << " size=" << size << endl;
         cout << " data=" << asciiToStringOfLength((char *)resultData, size) << endl;
 
-                // Test nillable element, with a value
-                xsd__base64Binary* nillableInput = new xsd__base64Binary();
-                *(nillableInput) = input;
-                xsd__base64Binary* nillableResult = ws->asNillableElement(nillableInput);
-                if (nillableResult)
-                {
-                        cout << "nillable element" << endl;
-            size = 0;
-            const xsd__unsignedByte * data = nillableResult->get(size);
+        // Test nillable element, with a value
+        nillableResult = ws->asNillableElement(&input);
+        if (nillableResult)
+        {
+            cout << "nillable element" << endl;
+            resultData = nillableResult->get(size);
             cout << " size=" << size << endl;
-            cout << " data=" << asciiToStringOfLength((char *)data, size) << endl;
+            cout << " data=" << asciiToStringOfLength((char *)resultData, size) << endl;
             delete nillableResult;
-                }
-                else
-                {
-                        cout << "nillable element=<nil>" << endl;
-                }
-       delete nillableInput;
+        }
+        else
+            cout << "nillable element=<nil>" << endl;
 
-                // Test nillable element, with nil
+        // Test nillable element, with nil
         nillableResult = ws->asNillableElement(NULL);
-                if (nillableResult)
-                {
+        if (nillableResult)
+        {
             cout << "nillable element" << endl;
-            size = 0;
-            const xsd__unsignedByte * data = nillableResult->get(size);
+            resultData = nillableResult->get(size);
             cout << " size=" << size << endl;
-            cout << " data=" << asciiToStringOfLength((char *)data, size) << endl;
+            cout << " data=" << asciiToStringOfLength((char *)resultData, size) << endl;
             delete nillableResult;
         }
-                else
-                {
-                        cout << "nil element=<nil>" << endl;
-                }
+        else
+            cout << "nil element=<nil>" << endl;
 
-                // Test array
+        // Test array
+#define ARRAY_SIZE 2                    
+        int i, outputSize=0;
+        
         xsd__base64Binary_Array arrayInput;
-                int arraySize=2;
-        xsd__base64Binary **array = new xsd__base64Binary*[arraySize];       
-        for (int inputIndex=0 ; inputIndex < 2 ; inputIndex++)
-        {
-            array[inputIndex] =new xsd__base64Binary(input);            
-        }
-                arrayInput.set(array,arraySize);
-                xsd__base64Binary_Array* arrayResult = ws->asArray(&arrayInput);
-                int outputSize=0;
-                const xsd__base64Binary **output=arrayResult->get(outputSize);
+        xsd__base64Binary_Array* arrayResult;
+        xsd__base64Binary *array[ARRAY_SIZE];
+        const xsd__base64Binary **output;
+        
+        for (i=0 ; i < 2 ; i++)
+            array[i] =new xsd__base64Binary(input);
+            
+        arrayInput.set(array,ARRAY_SIZE);
+        
+        arrayResult = ws->asArray(&arrayInput);
+        
+        if (arrayResult)
+            output=arrayResult->get(outputSize);
         cout << "array of " << outputSize << " elements" << endl;
-                for (int index = 0; index < outputSize ; index++)
-                {
-            size = 0;
-            const xsd__unsignedByte * data = output[index]->get(size);
-                        cout << " element[" << index << "]" << endl;
-            cout << "  size=" << size << endl;
-            cout << "  data=" << asciiToStringOfLength((char *) data, size) << endl;
-                }
-
-        for (int deleteIndex = 0 ; deleteIndex < arraySize ; deleteIndex++ )
+        for (i = 0; i < outputSize ; i++)
         {
-            delete array[deleteIndex];
+            resultData = output[i]->get(size);
+            cout << " element[" << i << "]" << endl;
+            cout << "  size=" << size << endl;
+            cout << "  data=" << asciiToStringOfLength((char *) resultData, size) << endl;
         }
-        delete [] array;
+
+        for (i = 0 ; i < ARRAY_SIZE ; i++ )
+            delete array[i];
         delete arrayResult;
 
-                // Test complex type
-                SimpleComplexType complexTypeInput;
-                complexTypeInput.setcomplexTypeElement(input);
-                SimpleComplexType* complexTypeResult = ws->asComplexType(&complexTypeInput);
+        // Test complex type
+        SimpleComplexType complexTypeInput;
+        SimpleComplexType* complexTypeResult;
+        
+        complexTypeInput.setcomplexTypeElement(input);
+        complexTypeResult = ws->asComplexType(&complexTypeInput);
         xsd__base64Binary binaryObject = complexTypeResult->getcomplexTypeElement();
-        size = 0;
-        const xsd__unsignedByte * data = binaryObject.get(size);
-                cout << "within complex type" << endl;
+        resultData = binaryObject.get(size);
+        cout << "within complex type" << endl;
         cout << " size=" << size << endl;
-        cout << " data=" << asciiToStringOfLength((char *)data, size) << endl;
-                delete complexTypeResult;
+        cout << " data=" << asciiToStringOfLength((char *)resultData, size) << endl;
+        delete complexTypeResult;
 
-                // Tests now complete
+        // Tests now complete
 
-                delete ws;
-        }
-        catch(AxisException& e)
-        {
-                cout << "Exception : " << e.what() << endl;
-        }
-        catch(exception& e)
-        {
-            cout << "Unknown exception has occured: " << e.what() << endl;
-        }
-        catch(...)
-        {
-            cout << "Unknown exception has occured" << endl;
-        }
+        delete ws;
+    }
+    catch(AxisException& e)
+    {
+        cout << "Exception : " << e.what() << endl;
+    }
+    catch(exception& e)
+    {
+        cout << "Unknown exception has occured: " << e.what() << endl;
+    }
+    catch(...)
+    {
+        cout << "Unknown exception has occured" << endl;
+    }
 
-        cout<< "---------------------- TEST COMPLETE -----------------------------"<< endl;
-        
-        return 0;
+    cout<< "---------------------- TEST COMPLETE -----------------------------"<< endl;
+
+    return 0;
 }
 

Modified: webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_hexBinaryClient.cpp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_hexBinaryClient.cpp?rev=405487&r1=405486&r2=405487&view=diff
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_hexBinaryClient.cpp (original)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_hexBinaryClient.cpp Tue May  9 10:58:51 2006
@@ -13,6 +13,14 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
+/* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! */
+/* NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE   */
+/* ----------------------------------------------------------------   */
+/* CHANGES TO THIS FILE MAY ALSO REQUIRE CHANGES TO THE               */
+/* C-EQUIVALENT FILE. PLEASE ENSURE THAT IT IS DONE.                  */
+/* ----------------------------------------------------------------   */
+/* NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE   */
+/* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! */
 
 #include "XSD_hexBinary.hpp"
 #include <axis/AxisException.hpp>
@@ -23,6 +31,17 @@
 
 int main(int argc, char* argv[])
 {
+    XSD_hexBinary* ws;
+    
+    xsd__hexBinary input;
+    xsd__hexBinary result;
+    xsd__hexBinary* nillableResult;
+    
+    xsd__unsignedByte* testUB;
+    
+    int size = 0;
+    const xsd__unsignedByte * resultData;    
+    
     char endpoint[256];
     const char* url="http://localhost:80/axis/XSD_hexBinary";
 
@@ -32,98 +51,90 @@
     try
     {
         sprintf(endpoint, "%s", url);
-        XSD_hexBinary* ws = new XSD_hexBinary(endpoint);
-
-        xsd__hexBinary input;
-
-        xsd__unsignedByte* testUB = (xsd__unsignedByte*)stringToAscii("<test><xml>some dod&y string</xml></test>");
+        ws = new XSD_hexBinary(endpoint);       
 
+        testUB = (xsd__unsignedByte*)stringToAscii("<test><xml>some dod&y string</xml></test>");
         input.set(testUB, 41);
 
         // Test non-nillable element
-        xsd__hexBinary result = ws->asNonNillableElement(input);
+        result = ws->asNonNillableElement(input);
         cout << "non-nillable element" << endl;
-        int size = 0;
-        const xsd__unsignedByte * data = result.get(size);
+
+        resultData = result.get(size);
         cout << " size=" << size << endl;
-        cout << " data=" << asciiToStringOfLength((char *)data, size) << endl;
+        cout << " data=" << asciiToStringOfLength((char *)resultData, size) << endl;
 
         // Test nillable element, with a value
-        xsd__hexBinary* nillableInput = new xsd__hexBinary();
-        *(nillableInput) = input;
-        xsd__hexBinary* nillableResult = ws->asNillableElement(nillableInput);
+        nillableResult = ws->asNillableElement(&input);
         if (nillableResult)
         {
             cout << "nillable element" << endl;
-            size = 0;
-            data = nillableResult->get(size);
+            resultData = nillableResult->get(size);
             cout << " size=" << size << endl;
-            cout << " data=" << asciiToStringOfLength((char *)data, size) << endl;
+            cout << " data=" << asciiToStringOfLength((char *)resultData, size) << endl;
             delete nillableResult;
         }
         else
-        {
             cout << "nillable element=<nil>" << endl;
-        }
-        delete nillableInput;
 
         // Test nillable element, with nil
         nillableResult = ws->asNillableElement(NULL);
         if (nillableResult)
         {
             cout << "nillable element" << endl;
-            size = 0 ;
-            data = nillableResult->get(size);
+            resultData = nillableResult->get(size);
             cout << " size=" << size << endl;
-            cout << " data=" << asciiToStringOfLength((char *)data, size) << endl;
+            cout << " data=" << asciiToStringOfLength((char *)resultData, size) << endl;
             delete nillableResult;
         }
         else
-        {
             cout << "nil element=<nil>" << endl;
-        }
 
         // Test array
+#define ARRAY_SIZE 2                    
+        int i, outputSize=0;
+        
         xsd__hexBinary_Array arrayInput;
-                int arraySize = 2;
-        xsd__hexBinary ** array = new xsd__hexBinary*[arraySize];
-        for (int inputIndex=0 ; inputIndex < arraySize ; inputIndex++)
-        {
-            array[inputIndex] = new xsd__hexBinary(input);            
-        }
-                arrayInput.set(array,arraySize);
-        xsd__hexBinary_Array* arrayResult = ws->asArray(&arrayInput);
-                int outputSize=0;
-                const xsd__hexBinary ** output =arrayResult->get(outputSize);
+        xsd__hexBinary_Array* arrayResult;
+        xsd__hexBinary * array[ARRAY_SIZE];
+        const xsd__hexBinary ** output;
+        
+        for (i=0 ; i < ARRAY_SIZE ; i++)
+            array[i] = new xsd__hexBinary(input);            
+
+        arrayInput.set(array,ARRAY_SIZE);
+        
+        arrayResult = ws->asArray(&arrayInput);
+        
+        if (arrayResult)
+             output =arrayResult->get(outputSize);
+             
         cout << "array of " << outputSize << " elements" << endl;
-        for (int index = 0; index < outputSize; index++)
+        for (i = 0; i < outputSize; i++)
         {
-            cout << " element[" << index << "]" << endl;
-            size = 0;
-            data = output[index]->get(size);
+            cout << " element[" << i << "]" << endl;
+            resultData = output[i]->get(size);
             cout << "  size=" << size << endl;
-            cout << "  data=" << asciiToStringOfLength((char *)data, size) << endl;
+            cout << "  data=" << asciiToStringOfLength((char *)resultData, size) << endl;
             
         }
         // Clear up input array        
-        for (int deleteIndex = 0 ; deleteIndex < arraySize ; deleteIndex++ )
-        {
-            delete array[deleteIndex];
-        }
-        delete [] array;
+        for (i = 0 ; i < ARRAY_SIZE ; i++ )
+            delete array[i];
         delete arrayResult;
 
 
         // Test complex type
         SimpleComplexType complexTypeInput;
+        SimpleComplexType* complexTypeResult;
+        
         complexTypeInput.setcomplexTypeElement(input);
-        SimpleComplexType* complexTypeResult = ws->asComplexType(&complexTypeInput);
+        complexTypeResult = ws->asComplexType(&complexTypeInput);
         cout << "within complex type" << endl;
         xsd__hexBinary binaryObject = complexTypeResult->getcomplexTypeElement();
-        size = 0;
-        data = binaryObject.get(size);
+        resultData = binaryObject.get(size);
         cout << " size=" << size << endl;
-        cout << " data=" << asciiToStringOfLength((char *)data, size) << endl;
+        cout << " data=" << asciiToStringOfLength((char *)resultData, size) << endl;
         delete complexTypeResult;
 
         // Tests now complete

Added: webservices/axis/trunk/c/tests/auto_build/testcases/tests/XSD_base64BinaryC.xml
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/tests/XSD_base64BinaryC.xml?rev=405487&view=auto
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/tests/XSD_base64BinaryC.xml (added)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/tests/XSD_base64BinaryC.xml Tue May  9 10:58:51 2006
@@ -0,0 +1,17 @@
+<test>
+    <name>XSD_base64BinaryC</name>
+    <description>Test serialization and deserialization of the XSD built-in simple type base64Binary</description>
+    <clientLang>c</clientLang>
+    <clientCode>XSD_base64BinaryClient.c</clientCode>
+    <wsdl>XSD_base64Binary.wsdl</wsdl>
+    <expected>
+        <output>
+            XSD_base64Binary.expected
+        </output>
+		<serverResponse>
+			XSD_base64Binary_ServerResponse.expected
+	    </serverResponse>
+    </expected>
+	<endpoint>http://localhost:80/axis/XSD_base64Binary</endpoint>
+</test>
+

Added: webservices/axis/trunk/c/tests/auto_build/testcases/tests/XSD_hexBinaryC.xml
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/tests/XSD_hexBinaryC.xml?rev=405487&view=auto
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/tests/XSD_hexBinaryC.xml (added)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/tests/XSD_hexBinaryC.xml Tue May  9 10:58:51 2006
@@ -0,0 +1,17 @@
+<test>
+    <name>XSD_hexBinaryC</name>
+    <description>Test serialization and deserialization of the XSD built-in simple type hexBinary</description>
+    <clientLang>c</clientLang>
+    <clientCode>XSD_hexBinaryClient.c</clientCode>
+    <wsdl>XSD_hexBinary.wsdl</wsdl>
+    <expected>
+        <output>
+            XSD_hexBinary.expected
+        </output>
+		<serverResponse>
+			XSD_hexBinary_ServerResponse.expected
+	    </serverResponse>
+    </expected>
+	<endpoint>http://localhost:80/axis/XSD_hexBinary</endpoint>
+</test>
+