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/16 16:29:35 UTC

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

Author: nadiramra
Date: Tue May 16 07:29:33 2006
New Revision: 406955

URL: http://svn.apache.org/viewcvs?rev=406955&view=rev
Log:
C support fixes/enhancements. Cleanup C++ testcase for porting to C.

Modified:
    webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/IHeaderBlockTest1Client.cpp
    webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/IHeaderBlockTest2Client.cpp
    webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/IHeaderBlockTest3Client.cpp
    webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/IHeaderBlockTest4Client.cpp
    webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/IHeaderBlockTest5Client.cpp
    webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/IHeaderBlockTest6Client.cpp
    webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/IHeaderBlockTest7Client.cpp
    webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/IHeaderBlockTest8Client.cpp

Modified: webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/IHeaderBlockTest1Client.cpp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/IHeaderBlockTest1Client.cpp?rev=406955&r1=406954&r2=406955&view=diff
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/IHeaderBlockTest1Client.cpp (original)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/IHeaderBlockTest1Client.cpp Tue May 16 07:29:33 2006
@@ -17,6 +17,16 @@
   @ Author : James Jose
 */
 
+/* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! */
+/* 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 "Calculator.hpp"
 #include <axis/IHeaderBlock.hpp>
 #include <axis/AxisException.hpp>
@@ -25,72 +35,75 @@
 
 int main(int argc, char* argv[])
 {
-        char endpoint[256];
-        const char* url="http://localhost:80/axis/Calculator";
-        const char* op = 0;
-        int i1=0, i2=0;
-        int iResult;
-        url = argv[1];
-                bool bSuccess = false;
-                int     iRetryIterationCount = 3;
+    char endpoint[256];
+    const char* url="http://localhost:80/axis/Calculator";
+    const char* op = 0;
+    int i1=0, i2=0;
+    int iResult;
+
+    bool bSuccess = false;
+    int     iRetryIterationCount = 3;
+    
+    const AxisChar *localname="TestHeader";
+    
+    IHeaderBlock *phb;
+    IHeaderBlock *fhb;
 
-                do
-                {
+    do
+    {
         try
         {
-                sprintf(endpoint, "%s", url);
-                Calculator ws(endpoint);
-                const AxisChar *localname="TestHeader";
-                op = "add";
-                i1 = 2;
-                i2 = 3; 
-                IHeaderBlock *phb = ws.createSOAPHeaderBlock("Test","http://ws.apache.org/axisCppTest/");
-                cout<<phb->setLocalName(NULL)<<endl;
-                cout<<phb->getLocalName()<<endl;
-                cout<<phb->setLocalName(localname)<<endl;               
-                IHeaderBlock *fhb=ws.getFirstSOAPHeaderBlock(); 
-                localname=fhb->getLocalName();
-                cout << "Local Name is " << localname << endl;
-                if (strcmp(op, "add") == 0)
-                {
-                        iResult=ws.add(i1, i2);                 
-                        cout << iResult << endl;
-                        bSuccess = true;
-                }
-                
+            if (argc > 1)
+                url = argv[1];
+            sprintf(endpoint, "%s", url);
+            Calculator ws(endpoint);
+
+            op = "add";
+            i1 = 2;
+            i2 = 3;
+            phb = ws.createSOAPHeaderBlock("Test","http://ws.apache.org/axisCppTest/");
+            cout<<phb->setLocalName(NULL)<<endl;
+            cout<<phb->getLocalName()<<endl;
+            cout<<phb->setLocalName(localname)<<endl;
+            fhb=ws.getFirstSOAPHeaderBlock();
+            localname=fhb->getLocalName();
+            cout << "Local Name is " << localname << endl;
+            if (strcmp(op, "add") == 0)
+            {
+                iResult=ws.add(i1, i2);
+                cout << iResult << endl;
+                bSuccess = true;
+            }
+
         }
         catch(AxisException& e)
         {
-                        bool bSilent = false;
+            bool bSilent = false;
 
-                        if( e.getExceptionCode() == CLIENT_TRANSPORT_OPEN_CONNECTION_FAILED)
-                        {
-                                if( iRetryIterationCount > 0)
-                                {
-                                        bSilent = true;
-                                }
-                        }
-                        else
-                        {
-                                iRetryIterationCount = 0;
-                        }
+            if( e.getExceptionCode() == CLIENT_TRANSPORT_OPEN_CONNECTION_FAILED)
+            {
+                if( iRetryIterationCount > 0)
+                    bSilent = true;
+            }
+            else
+                iRetryIterationCount = 0;
 
             if( !bSilent)
-                        {
-                                cout << "Exception : " << e.what() << endl;
-                        }
+                cout << "Exception : " << e.what() << endl;
         }
         catch(exception& e)
         {
-                cout << "Unknown exception has occured" << endl;
+            cout << "Unknown exception has occured" << endl;
         }
         catch(...)
         {
-                cout << "Unspecified exception has occured" << endl;
+            cout << "Unspecified exception has occured" << endl;
         }
-                iRetryIterationCount--;
-                } while( iRetryIterationCount > 0 && !bSuccess);
-        cout<< "---------------------- TEST COMPLETE -----------------------------"<< endl;     
-        return 0;
+        iRetryIterationCount--;
+    } 
+    while( iRetryIterationCount > 0 && !bSuccess);
+    
+    cout<< "---------------------- TEST COMPLETE -----------------------------"<< endl;
+    return 0;
 }
 

Modified: webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/IHeaderBlockTest2Client.cpp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/IHeaderBlockTest2Client.cpp?rev=406955&r1=406954&r2=406955&view=diff
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/IHeaderBlockTest2Client.cpp (original)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/IHeaderBlockTest2Client.cpp Tue May 16 07:29:33 2006
@@ -17,6 +17,14 @@
 @ Author : James Jose
 */
 
+/* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! */
+/* 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 "Calculator.hpp"
 #include <axis/IHeaderBlock.hpp>
@@ -26,71 +34,71 @@
 
 int main(int argc, char* argv[])
 {
-        char endpoint[256];
-        const char* url="http://localhost:80/axis/Calculator";
-        const char* op = 0;
-        int i1=0, i2=0;
-        int iResult;
-        url = argv[1];
-                bool bSuccess = false;
-                int     iRetryIterationCount = 3;
+    char endpoint[256];
+    const char* url="http://localhost:80/axis/Calculator";
+    const char* op = 0;
+    int i1=0, i2=0;
+    int iResult;
 
-                do
-                {
+    bool bSuccess = false;
+    int     iRetryIterationCount = 3;
+    
+    const AxisChar *prefix="np";
+    const AxisChar *uri="http://axis.apache.com";
+    IHeaderBlock *phb;
+    
+    do
+    {
         try
         {
-                sprintf(endpoint, "%s", url);
-                Calculator ws(endpoint);
-                op = "add";
-                i1 = 2;
-                i2 = 3; 
-                const AxisChar *prefix="np";
-                const AxisChar *uri="http://axis.apache.com";
-                IHeaderBlock *phb = ws.createSOAPHeaderBlock("TestHeader","http://apache.org/");
-                cout<<phb->setPrefix(NULL)<<endl;
-                cout<<phb->setPrefix(prefix)<<endl;
-                cout<<phb->setURI(NULL)<<endl;
-                cout<<phb->setURI(uri)<<endl;           
-                if (strcmp(op, "add") == 0)
-                {
-                        iResult=ws.add(i1, i2); 
-                        cout << iResult << endl;
-                        bSuccess = true;
-                }
-            
+            if (argc > 1)
+                url = argv[1];
+            sprintf(endpoint, "%s", url);
+            Calculator ws(endpoint);
+            op = "add";
+            i1 = 2;
+            i2 = 3;
+
+            phb = ws.createSOAPHeaderBlock("TestHeader","http://apache.org/");
+            cout<<phb->setPrefix(NULL)<<endl;
+            cout<<phb->setPrefix(prefix)<<endl;
+            cout<<phb->setURI(NULL)<<endl;
+            cout<<phb->setURI(uri)<<endl;
+            if (strcmp(op, "add") == 0)
+            {
+                iResult=ws.add(i1, i2);
+                cout << iResult << endl;
+                bSuccess = true;
+            }
         }
         catch(AxisException& e)
         {
-                        bool bSilent = false;
+            bool bSilent = false;
 
-                        if( e.getExceptionCode() == CLIENT_TRANSPORT_OPEN_CONNECTION_FAILED)
-                        {
-                                if( iRetryIterationCount > 0)
-                                {
-                                        bSilent = true;
-                                }
-                        }
-                        else
-                        {
-                                iRetryIterationCount = 0;
-                        }
+            if( e.getExceptionCode() == CLIENT_TRANSPORT_OPEN_CONNECTION_FAILED)
+            {
+                if( iRetryIterationCount > 0)
+                    bSilent = true;
+            }
+            else
+                iRetryIterationCount = 0;
 
             if( !bSilent)
-                        {
-                                cout << "Exception : " << e.what() << endl;
-                        }
+                cout << "Exception : " << e.what() << endl;
         }
         catch(exception& e)
         {
-                cout << "Unknown exception has occured" << endl;
+            cout << "Unknown exception has occured" << endl;
         }
         catch(...)
         {
-                cout << "Unspecified exception has occured" << endl;
+            cout << "Unspecified exception has occured" << endl;
         }
-                iRetryIterationCount--;
-                } while( iRetryIterationCount > 0 && !bSuccess);
-        cout<< "---------------------- TEST COMPLETE -----------------------------"<< endl;     
-        return 0;
+        iRetryIterationCount--;
+    } 
+    while( iRetryIterationCount > 0 && !bSuccess);
+    
+    cout<< "---------------------- TEST COMPLETE -----------------------------"<< endl;
+    return 0;
 }
 

Modified: webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/IHeaderBlockTest3Client.cpp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/IHeaderBlockTest3Client.cpp?rev=406955&r1=406954&r2=406955&view=diff
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/IHeaderBlockTest3Client.cpp (original)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/IHeaderBlockTest3Client.cpp Tue May 16 07:29:33 2006
@@ -17,6 +17,14 @@
 /* Tests createNamespaceDecl(),createAttribute() and getAttributeValue() APIs in IHeaderBlock 
 @ Author : James Jose
 */
+/* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! */
+/* 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 "Calculator.hpp"
@@ -28,89 +36,93 @@
 
 int main(int argc, char* argv[])
 {
-        char endpoint[256];
-        const char* url="http://localhost:80/axis/Calculator";
-        const char* op = 0;
-        int i1=0, i2=0;
-        int iResult;
-        url = argv[1];
-                bool bSuccess = false;
-                int     iRetryIterationCount = 3;
-
-                do
-                {
+    char endpoint[256];
+    const char* url="http://localhost:80/axis/Calculator";
+    const char* op = 0;
+    int i1=0, i2=0;
+    int iResult;
+
+    bool bSuccess = false;
+    int     iRetryIterationCount = 3;
+    
+    const AxisChar *prefix="np";
+    const AxisChar *uri="http://ws.apache.org/";
+    const AxisChar *temp="apache";
+    const AxisChar *localname="name";
+
+    IHeaderBlock *phb;
+    INamespace *Insp1, *Insp2;
+    IAttribute *attr1, *attr2;
+    IAttribute *Iattr1, *Iattr2, *Iattr3;
+    
+    do
+    {
         try
         {
-                sprintf(endpoint, "%s", url);
-                Calculator ws(endpoint);
-                op = "add";
-                i1 = 2;
-                i2 = 3; 
-                const AxisChar *prefix="np";
-                const AxisChar *uri="http://ws.apache.org/";
-                IHeaderBlock *phb = ws.createSOAPHeaderBlock("TestHeader","http://ws.apache.org/");
-                INamespace *Insp1=phb->createNamespaceDecl(prefix,uri);                 
-                INamespace *Insp2=phb->createNamespaceDecl("np1","http://axis.apache.org/");
-
-                IAttribute *attr1=phb->createAttribute(NULL,NULL,NULL,NULL);
-        IAttribute *attr2=phb->createAttribute(NULL,NULL,NULL);
-                if(attr1 || attr2)
-                        cout << "Attribute returned for NULL arguments in createAttribute"<<endl;
-
-                const AxisChar *temp="apache";
-                const AxisChar *localname="name";       
-                IAttribute *Iattr1=phb->createAttribute(localname,prefix,temp);         
-                IAttribute *Iattr2=phb->createAttribute(localname,"np1","","Axis");             
-                IAttribute *Iattr3=phb->createAttribute(localname,"","","");            
-
-                cout << "np:name=" << phb->getAttributeValue(localname,prefix)<<endl;
-                cout << "np1:name=" << phb->getAttributeValue("name","np1")<<endl;
-                cout <<"name=" << phb->getAttributeValue("name","")<<endl;
-                if(phb->getAttributeValue(NULL,NULL)!=NULL)
-                        cout<<"NULL is not returned for NULL argumets in getAttributeValue"<<endl;
-                if(phb->getAttributeValue("name","nm")!=NULL)
-                        cout<<"NULL is not returned for Non existing attribute"<<endl;
-                if(phb->getAttributeValue("NAME","np1")!=NULL)
-                        cout<<"NULL is not returned for Non existing Attribute"<<endl;
-                if (strcmp(op, "add") == 0)
-                {
-                        iResult=ws.add(i1, i2);                 
-                        cout << iResult << endl;
-                }
+            if (argc > 1)
+                url = argv[1];
+            sprintf(endpoint, "%s", url);
+            Calculator ws(endpoint);
+            op = "add";
+            i1 = 2;
+            i2 = 3;
+            phb = ws.createSOAPHeaderBlock("TestHeader","http://ws.apache.org/");
+            Insp1=phb->createNamespaceDecl(prefix,uri);
+            Insp2=phb->createNamespaceDecl("np1","http://axis.apache.org/");
+
+            attr1=phb->createAttribute(NULL,NULL,NULL,NULL);
+            attr2=phb->createAttribute(NULL,NULL,NULL);
+            if(attr1 || attr2)
+                cout << "Attribute returned for NULL arguments in createAttribute"<<endl;
+
+            Iattr1=phb->createAttribute(localname,prefix,temp);
+            Iattr2=phb->createAttribute(localname,"np1","","Axis");
+            Iattr3=phb->createAttribute(localname,"","","");
+
+            cout << "np:name=" << phb->getAttributeValue(localname,prefix)<<endl;
+            cout << "np1:name=" << phb->getAttributeValue("name","np1")<<endl;
+            cout <<"name=" << phb->getAttributeValue("name","")<<endl;
+            if(phb->getAttributeValue(NULL,NULL)!=NULL)
+                cout<<"NULL is not returned for NULL argumets in getAttributeValue"<<endl;
+            if(phb->getAttributeValue("name","nm")!=NULL)
+                cout<<"NULL is not returned for Non existing attribute"<<endl;
+            if(phb->getAttributeValue("NAME","np1")!=NULL)
+                cout<<"NULL is not returned for Non existing Attribute"<<endl;
+            if (strcmp(op, "add") == 0)
+            {
+                iResult=ws.add(i1, i2);
+                cout << iResult << endl;
+            }
             bSuccess = true;
 
         }
         catch(AxisException& e)
         {
-                        bool bSilent = false;
+            bool bSilent = false;
 
-                        if( e.getExceptionCode() == CLIENT_TRANSPORT_OPEN_CONNECTION_FAILED)
-                        {
-                                if( iRetryIterationCount > 0)
-                                {
-                                        bSilent = true;
-                                }
-                        }
-                        else
-                        {
-                                iRetryIterationCount = 0;
-                        }
+            if( e.getExceptionCode() == CLIENT_TRANSPORT_OPEN_CONNECTION_FAILED)
+            {
+                if( iRetryIterationCount > 0)
+                    bSilent = true;
+            }
+            else
+                iRetryIterationCount = 0;
 
             if( !bSilent)
-                        {
-                                cout << "Exception : " << e.what() << endl;
-                        }
+                cout << "Exception : " << e.what() << endl;
         }
         catch(exception& e)
         {
-                cout << "Unknown exception has occured" << endl;
+            cout << "Unknown exception has occured" << endl;
         }
         catch(...)
         {
-                cout << "Unspecified exception has occured" << endl;
+            cout << "Unspecified exception has occured" << endl;
         }
-                iRetryIterationCount--;
-                } while( iRetryIterationCount > 0 && !bSuccess);
-        cout<< "---------------------- TEST COMPLETE -----------------------------"<< endl;     
-        return 0;
+        iRetryIterationCount--;
+    } 
+    while( iRetryIterationCount > 0 && !bSuccess);
+    
+    cout<< "---------------------- TEST COMPLETE -----------------------------"<< endl;
+    return 0;
 }

Modified: webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/IHeaderBlockTest4Client.cpp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/IHeaderBlockTest4Client.cpp?rev=406955&r1=406954&r2=406955&view=diff
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/IHeaderBlockTest4Client.cpp (original)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/IHeaderBlockTest4Client.cpp Tue May 16 07:29:33 2006
@@ -17,6 +17,14 @@
 /* Tests createChild(),addChild(),getNoOfChildren() and getchild() APIs 
 @ Author : James Jose
 */
+/* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! */
+/* 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 "Calculator.hpp"
 #include <axis/IHeaderBlock.hpp>
@@ -27,104 +35,109 @@
 
 int main(int argc, char* argv[])
 {
-        char endpoint[256];
-        const char* url="http://localhost:80/axis/Calculator";
-        const char* op = 0;
-        int i1=0, i2=0;
-        int iResult;
-        url = argv[1];
-                bool bSuccess = false;
-                int     iRetryIterationCount = 3;
+    char endpoint[256];
+    const char* url="http://localhost:80/axis/Calculator";
+    const char* op = 0;
+    int i1=0, i2=0;
+    int iResult;
 
-                do
-                {
+    bool bSuccess = false;
+    int     iRetryIterationCount = 3;
+
+    IHeaderBlock *phb;
+    BasicNode *ch;
+    BasicNode *Bnode1, *Bnode2, *Bnode3, *Bnode4,*Bnode4a, *Bnode5, *Bnode6, *Bnode7, *Bnode8;
+    BasicNode * firstnode, *secondnode, *parentnode, *childnode, *lastnode;
+    IAttribute *a;
+        
+    AxisChar *localname="Name";
+    AxisChar *prefix="np";
+    AxisChar *uri="http://ws.apache.org/";
+    
+    do
+    {
         try
         {
-                sprintf(endpoint, "%s", url);
-                Calculator ws(endpoint);
-                op = "add";
-                i1 = 2;
-                i2 = 3; 
-                AxisChar *localname="Name";
-                AxisChar *prefix="np";
-                AxisChar *uri="http://ws.apache.org/";
-                IHeaderBlock *phb = ws.createSOAPHeaderBlock("TestHeader","http://ws.apache.org/");             
-                BasicNode * Bnode1=phb->createChild(ELEMENT_NODE,localname,prefix,uri, NULL);
-                /*Passing NULL as argument*/
-                if(phb->createChild(ELEMENT_NODE,NULL,NULL,NULL, NULL))
-                        cout<<"NULL Returned for Element_node"<<endl;
-                if(phb->createChild(CHARACTER_NODE,NULL,NULL,NULL, NULL))
-                        cout<<"NULL Returned for Character_node"<<endl;
-                BasicNode * Bnode2=phb->createChild(CHARACTER_NODE,NULL,NULL,NULL,"APACHE");
-                BasicNode * Bnode3=phb->createChild(ELEMENT_NODE,"FirstPart","np1","http://ws.apache.org/", NULL);
-                BasicNode * Bnode4=phb->createChild(ELEMENT_NODE,"LastPart","","http://ws.apache.org/", NULL);
-                BasicNode * Bnode5=phb->createChild(CHARACTER_NODE,"","","","APACHE");          
-                BasicNode * Bnode6=phb->createChild(ELEMENT_NODE);
-                Bnode6->setLocalName("Project");
-                IAttribute *a=Bnode6->createAttribute("Type","Open Source");
-        cout <<"Project Type=" << a->getValue() << endl;
-                BasicNode * Bnode7=phb->createChild(CHARACTER_NODE);
-                Bnode7->setValue("AXISCPP");
-        BasicNode * Bnode4a=phb->createChild(ELEMENT_NODE,"LastPartChild","","http://ws.apache.org/", NULL);
-        Bnode4->addChild(Bnode4a);
-                Bnode6->addChild(Bnode7);
-                Bnode3->addChild(Bnode2);
-                Bnode4a->addChild(Bnode5);
-                Bnode1->addChild(Bnode3);
-                Bnode1->addChild(Bnode4);
-                phb->addChild(Bnode1);
-                phb->addChild(Bnode6);
-                BasicNode * Bnode8=phb->createChild(CHARACTER_NODE,"","","","This is a test message");
-                cout << phb->addChild(Bnode8)<<endl;
-                cout<<"AddChild returned "<< phb->addChild(NULL) << " For NULL Value "<< endl;
-                cout << "No Of Children = " << phb->getNoOfChildren()<<endl;
-            BasicNode * firstnode=phb->getFirstChild();
-                cout << "First Node Name = " << firstnode->getLocalName() << endl;
-                BasicNode * secondnode=phb->getChild(2);
-                BasicNode *childnode=secondnode->getFirstChild();
-                cout << "Second Node Name=" << secondnode->getLocalName() << " Value = " << childnode->getValue()<< endl ;
-                cout << "Second Node Type = " << secondnode->getNodeType() << endl;
-                BasicNode * lastnode=phb->getLastChild();
-                cout  << "Last Node Value = " << lastnode->getValue() << endl;
-                cout  << "Last Node Type = " << lastnode->getNodeType() << endl;
-        if (strcmp(op, "add") == 0)
-                {
-                        iResult=ws.add(i1, i2);                 
-                        cout  << iResult << endl;
-                }
+            if (argc > 1)
+                url = argv[1];
+            sprintf(endpoint, "%s", url);
+            Calculator ws(endpoint);
+            op = "add";
+            i1 = 2;
+            i2 = 3;
+            phb = ws.createSOAPHeaderBlock("TestHeader","http://ws.apache.org/");
+            Bnode1=phb->createChild(ELEMENT_NODE,localname,prefix,uri, NULL);
+            /*Passing NULL as argument*/
+            if(phb->createChild(ELEMENT_NODE,NULL,NULL,NULL, NULL))
+                cout<<"NULL Returned for Element_node"<<endl;
+            if(phb->createChild(CHARACTER_NODE,NULL,NULL,NULL, NULL))
+                cout<<"NULL Returned for Character_node"<<endl;
+            Bnode2=phb->createChild(CHARACTER_NODE,NULL,NULL,NULL,"APACHE");
+            Bnode3=phb->createChild(ELEMENT_NODE,"FirstPart","np1","http://ws.apache.org/", NULL);
+            Bnode4=phb->createChild(ELEMENT_NODE,"LastPart","","http://ws.apache.org/", NULL);
+            Bnode5=phb->createChild(CHARACTER_NODE,"","","","APACHE");
+            Bnode6=phb->createChild(ELEMENT_NODE);
+            Bnode6->setLocalName("Project");
+            a=Bnode6->createAttribute("Type","Open Source");
+            cout <<"Project Type=" << a->getValue() << endl;
+            Bnode7=phb->createChild(CHARACTER_NODE);
+            Bnode7->setValue("AXISCPP");
+            Bnode4a=phb->createChild(ELEMENT_NODE,"LastPartChild","","http://ws.apache.org/", NULL);
+            Bnode4->addChild(Bnode4a);
+            Bnode6->addChild(Bnode7);
+            Bnode3->addChild(Bnode2);
+            Bnode4a->addChild(Bnode5);
+            Bnode1->addChild(Bnode3);
+            Bnode1->addChild(Bnode4);
+            phb->addChild(Bnode1);
+            phb->addChild(Bnode6);
+            Bnode8=phb->createChild(CHARACTER_NODE,"","","","This is a test message");
+            cout << phb->addChild(Bnode8)<<endl;
+            cout<<"AddChild returned "<< phb->addChild(NULL) << " For NULL Value "<< endl;
+            cout << "No Of Children = " << phb->getNoOfChildren()<<endl;
+            firstnode=phb->getFirstChild();
+            cout << "First Node Name = " << firstnode->getLocalName() << endl;
+            secondnode=phb->getChild(2);
+            childnode=secondnode->getFirstChild();
+            cout << "Second Node Name=" << secondnode->getLocalName() << " Value = " << childnode->getValue()<< endl ;
+            cout << "Second Node Type = " << secondnode->getNodeType() << endl;
+            lastnode=phb->getLastChild();
+            cout  << "Last Node Value = " << lastnode->getValue() << endl;
+            cout  << "Last Node Type = " << lastnode->getNodeType() << endl;
+            if (strcmp(op, "add") == 0)
+            {
+                iResult=ws.add(i1, i2);
+                cout  << iResult << endl;
+            }
             bSuccess = true;
         }
         catch(AxisException& e)
         {
-                        bool bSilent = false;
+            bool bSilent = false;
 
-                        if( e.getExceptionCode() == CLIENT_TRANSPORT_OPEN_CONNECTION_FAILED)
-                        {
-                                if( iRetryIterationCount > 0)
-                                {
-                                        bSilent = true;
-                                }
-                        }
-                        else
-                        {
-                                iRetryIterationCount = 0;
-                        }
+            if( e.getExceptionCode() == CLIENT_TRANSPORT_OPEN_CONNECTION_FAILED)
+            {
+                if( iRetryIterationCount > 0)
+                    bSilent = true;
+            }
+            else
+                iRetryIterationCount = 0;
 
             if( !bSilent)
-                        {
-                                cout << "Exception : " << e.what() << endl;
-                        }
+                cout << "Exception : " << e.what() << endl;
         }
         catch(exception& e)
         {
-                cout << "Unknown exception has occured" << endl;
+            cout << "Unknown exception has occured" << endl;
         }
         catch(...)
         {
-                cout << "Unspecified exception has occured" << endl;
+            cout << "Unspecified exception has occured" << endl;
         }
-                iRetryIterationCount--;
-                } while( iRetryIterationCount > 0 && !bSuccess);
-        cout<< "---------------------- TEST COMPLETE -----------------------------"<< endl;     
-        return 0;
+        iRetryIterationCount--;
+    } 
+    while( iRetryIterationCount > 0 && !bSuccess);
+    
+    cout<< "---------------------- TEST COMPLETE -----------------------------"<< endl;
+    return 0;
 }

Modified: webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/IHeaderBlockTest5Client.cpp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/IHeaderBlockTest5Client.cpp?rev=406955&r1=406954&r2=406955&view=diff
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/IHeaderBlockTest5Client.cpp (original)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/IHeaderBlockTest5Client.cpp Tue May 16 07:29:33 2006
@@ -17,6 +17,14 @@
 /* Tests createImmdediateChild() APIs and getChild() API
 @ Author : James Jose
 */
+/* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! */
+/* 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 "Calculator.hpp"
@@ -28,119 +36,124 @@
 
 int main(int argc, char* argv[])
 {
-        char endpoint[256];
-        const char* url="http://localhost:80/axis/Calculator";
-        const char* op = 0;
-        int i1=0, i2=0;
-        int iResult;
-        url = argv[1];
-                bool bSuccess = false;
-                int     iRetryIterationCount = 3;
-
-                do
-                {
+    char endpoint[256];
+    const char* url="http://localhost:80/axis/Calculator";
+    const char* op = 0;
+    int i1=0, i2=0;
+    int iResult;
+
+    bool bSuccess = false;
+    int     iRetryIterationCount = 3;
+    
+    AxisChar *localname="Name";
+    AxisChar *prefix="np";
+    AxisChar *uri="http://ws.apache.org/";
+
+    IHeaderBlock *phb;
+    BasicNode *Bnoden, *Bnoden2;
+    BasicNode *ch;
+    BasicNode *Bnode1, *Bnode2, *Bnode3, *Bnode4, *Bnode5, *Bnode6, *Bnode7, *Bnode8, *Bnode9;
+    BasicNode * firstnode, *parentnode, *childnode, *lastnode;
+    BasicNode *nullNode, *nullNode1, *nullNode2;
+    IAttribute *a;
+    
+    do
+    {
         try
         {
-                sprintf(endpoint, "%s", url);
-                Calculator ws(endpoint);
-                op = "add";
-                i1 = 2;
-                i2 = 3; 
-                AxisChar *localname="Name";
-                AxisChar *prefix="np";
-                AxisChar *uri="http://ws.apache.org/";
-                IHeaderBlock *phb = ws.createSOAPHeaderBlock("TestHeader","http://ws.apache.org/");
-
-                
-                /*An element node Bnoden1 is created  and set its name using setLocalName() */
-                BasicNode * Bnoden=phb->createImmediateChild(ELEMENT_NODE,NULL,NULL,NULL,NULL);
-                cout<<Bnoden->getNodeType()<<endl;
-        Bnoden->setLocalName("Project");
-                BasicNode *ch=phb->createChild(CHARACTER_NODE,NULL,NULL,NULL,"AXISCPP");
-                Bnoden->addChild(ch);
-
-                BasicNode * Bnoden2=phb->createImmediateChild(CHARACTER_NODE,NULL,NULL,NULL,NULL);
-                if(Bnoden2==NULL)
-                        cout << "Null returned for Character_node" << endl;
-                else{
-                        Bnoden2->setValue("AXISCPP");
-                }
-
-
-                BasicNode * Bnode1=phb->createImmediateChild(ELEMENT_NODE,localname,prefix,uri, NULL);  
-        BasicNode * Bnode2=phb->createChild(CHARACTER_NODE,NULL,NULL,NULL,"AXIS");
-                BasicNode * Bnode3=phb->createChild(ELEMENT_NODE,"FirstPart","np1","http://ws.apache.org/", NULL);
-                BasicNode * Bnode4=phb->createImmediateChild(ELEMENT_NODE,"Location","","http://ws.apache.org/", NULL);
-                BasicNode * Bnode5=phb->createChild(CHARACTER_NODE,"","","","Sri Lanka");               
-                BasicNode * Bnode6=phb->createImmediateChild(ELEMENT_NODE);
-                Bnode6->setLocalName("Project");
-                IAttribute *a=Bnode6->createAttribute("Type","Open Source");                    
-                        cout << "Project Type=" << a->getValue()<< endl ;
-                BasicNode * Bnode7=phb->createChild(CHARACTER_NODE);
-                Bnode7->setValue("AXISCPP");
-                Bnode6->addChild(Bnode7);
-                Bnode3->addChild(Bnode2);
-                Bnode4->addChild(Bnode5);
-                Bnode1->addChild(Bnode3);               
-                BasicNode * Bnode8=phb->createImmediateChild(CHARACTER_NODE,"","","","This is a test ");
-                BasicNode *Bnode9=phb->createImmediateChild(CHARACTER_NODE);
-                Bnode9->setValue("message");
-                cout << "No Of Children=" << phb->getNoOfChildren()<< endl ;
-            BasicNode * firstnode=phb->getFirstChild();
-                cout << "First Node Name = " << firstnode->getLocalName()<< endl ;
-                BasicNode * parentnode=phb->getChild(5);
-                BasicNode * childnode=parentnode->getFirstChild();              
-                cout << "Parent Node Name = " << parentnode->getLocalName();
-                cout <<  " Value =" << childnode->getValue() << endl;
-                BasicNode * lastnode=phb->getLastChild();
-                cout  << "Last Child Value=" << lastnode->getValue()<< endl;
-                BasicNode *nullNode=phb->getChild(phb->getNoOfChildren()+1);
-                if(nullNode!=NULL)
-                        cout << "NULL is not returned for non existing node" << endl ;
-                BasicNode *nullNode1=phb->getChild(0);
-                if(nullNode1!=NULL)
-                        cout << "NULL is not returned for child location 0"<< endl ;
-                BasicNode *nullNode2=phb->getChild(-2);
-                if(nullNode2!=NULL)
-                        cout << "NULL is not returned for -ve  child location"<< endl;
-                if (strcmp(op, "add") == 0)
-                {
-                        iResult=ws.add(i1, i2); 
-                        cout << iResult << endl;
-                }
+            if (argc > 1)
+                url = argv[1];
+            sprintf(endpoint, "%s", url);
+            Calculator ws(endpoint);
+            op = "add";
+            i1 = 2;
+            i2 = 3;
+            phb = ws.createSOAPHeaderBlock("TestHeader","http://ws.apache.org/");
+
+            /*An element node Bnoden1 is created  and set its name using setLocalName() */
+            Bnoden=phb->createImmediateChild(ELEMENT_NODE,NULL,NULL,NULL,NULL);
+            cout<<Bnoden->getNodeType()<<endl;
+            Bnoden->setLocalName("Project");
+            ch=phb->createChild(CHARACTER_NODE,NULL,NULL,NULL,"AXISCPP");
+            Bnoden->addChild(ch);
+
+            Bnoden2=phb->createImmediateChild(CHARACTER_NODE,NULL,NULL,NULL,NULL);
+            if(Bnoden2==NULL)
+                cout << "Null returned for Character_node" << endl;
+            else
+                Bnoden2->setValue("AXISCPP");
+
+
+            Bnode1=phb->createImmediateChild(ELEMENT_NODE,localname,prefix,uri, NULL);
+            Bnode2=phb->createChild(CHARACTER_NODE,NULL,NULL,NULL,"AXIS");
+            Bnode3=phb->createChild(ELEMENT_NODE,"FirstPart","np1","http://ws.apache.org/", NULL);
+            Bnode4=phb->createImmediateChild(ELEMENT_NODE,"Location","","http://ws.apache.org/", NULL);
+            Bnode5=phb->createChild(CHARACTER_NODE,"","","","Sri Lanka");
+            Bnode6=phb->createImmediateChild(ELEMENT_NODE);
+            Bnode6->setLocalName("Project");
+            a=Bnode6->createAttribute("Type","Open Source");
+            cout << "Project Type=" << a->getValue()<< endl ;
+            Bnode7=phb->createChild(CHARACTER_NODE);
+            Bnode7->setValue("AXISCPP");
+            Bnode6->addChild(Bnode7);
+            Bnode3->addChild(Bnode2);
+            Bnode4->addChild(Bnode5);
+            Bnode1->addChild(Bnode3);
+            Bnode8=phb->createImmediateChild(CHARACTER_NODE,"","","","This is a test ");
+            Bnode9=phb->createImmediateChild(CHARACTER_NODE);
+            Bnode9->setValue("message");
+            cout << "No Of Children=" << phb->getNoOfChildren()<< endl ;
+            firstnode=phb->getFirstChild();
+            cout << "First Node Name = " << firstnode->getLocalName()<< endl ;
+            parentnode=phb->getChild(5);
+            childnode=parentnode->getFirstChild();
+            cout << "Parent Node Name = " << parentnode->getLocalName();
+            cout <<  " Value =" << childnode->getValue() << endl;
+            lastnode=phb->getLastChild();
+            cout  << "Last Child Value=" << lastnode->getValue()<< endl;
+            nullNode=phb->getChild(phb->getNoOfChildren()+1);
+            if(nullNode!=NULL)
+                cout << "NULL is not returned for non existing node" << endl ;
+            nullNode1=phb->getChild(0);
+            if(nullNode1!=NULL)
+                cout << "NULL is not returned for child location 0"<< endl ;
+            nullNode2=phb->getChild(-2);
+            if(nullNode2!=NULL)
+                cout << "NULL is not returned for -ve  child location"<< endl;
+            if (strcmp(op, "add") == 0)
+            {
+                iResult=ws.add(i1, i2);
+                cout << iResult << endl;
+            }
             bSuccess = true;
         }
         catch(AxisException& e)
         {
-                        bool bSilent = false;
+            bool bSilent = false;
 
-                        if( e.getExceptionCode() == CLIENT_TRANSPORT_OPEN_CONNECTION_FAILED)
-                        {
-                                if( iRetryIterationCount > 0)
-                                {
-                                        bSilent = true;
-                                }
-                        }
-                        else
-                        {
-                                iRetryIterationCount = 0;
-                        }
+            if( e.getExceptionCode() == CLIENT_TRANSPORT_OPEN_CONNECTION_FAILED)
+            {
+                if( iRetryIterationCount > 0)
+                    bSilent = true;
+            }
+            else
+                iRetryIterationCount = 0;
 
             if( !bSilent)
-                        {
-                                cout << "Exception : " << e.what() << endl;
-                        }
+                cout << "Exception : " << e.what() << endl;
         }
         catch(exception& e)
         {
-                cout << "Unknown exception has occured" << endl;
+            cout << "Unknown exception has occured" << endl;
         }
         catch(...)
         {
-                cout << "Unspecified exception has occured" << endl;
+            cout << "Unspecified exception has occured" << endl;
         }
-                iRetryIterationCount--;
-                } while( iRetryIterationCount > 0 && !bSuccess);
-        cout<< "---------------------- TEST COMPLETE -----------------------------"<< endl;     
-        return 0;
+        iRetryIterationCount--;
+    } 
+    while( iRetryIterationCount > 0 && !bSuccess);
+    
+    cout<< "---------------------- TEST COMPLETE -----------------------------"<< endl;
+    return 0;
 }

Modified: webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/IHeaderBlockTest6Client.cpp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/IHeaderBlockTest6Client.cpp?rev=406955&r1=406954&r2=406955&view=diff
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/IHeaderBlockTest6Client.cpp (original)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/IHeaderBlockTest6Client.cpp Tue May 16 07:29:33 2006
@@ -17,6 +17,14 @@
 /*This program tests clone() API in the IHeaderBlock class
 @ Author : James Jose
 */
+/* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! */
+/* 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 "Calculator.hpp"
@@ -27,75 +35,77 @@
 
 int main(int argc, char* argv[])
 {
-        char endpoint[256];
-        const char* url="http://localhost:80/axis/Calculator";
-        const char* op = 0;
-        int i1=0, i2=0;
-        int iResult;
-        url = argv[1];
-                bool bSuccess = false;
-                int     iRetryIterationCount = 3;
-
-                do
-                {
+    char endpoint[256];
+    const char* url="http://localhost:80/axis/Calculator";
+    const char* op = 0;
+    int i1=0, i2=0;
+    int iResult;
+
+    bool bSuccess = false;
+    int     iRetryIterationCount = 3;
+
+    IHeaderBlock *phb;
+    IHeaderBlock *cl;
+    BasicNode * bn, *bn1, *bn2;
+    
+    do
+    {
         try
         {
-                sprintf(endpoint, "%s", url);
-                Calculator ws(endpoint);
-                IHeaderBlock *phb=ws.createSOAPHeaderBlock("TestHeader","http://apache.com","np");
-                phb->createImmediateChild(CHARACTER_NODE,"","","","Test Message");
-                IHeaderBlock *cl=phb->clone();
-                cl->createImmediateChild(ELEMENT_NODE,"Name","","","");
-                cout << "No of Child in clone=" << cl->getNoOfChildren();
-                cout << endl << "No of Child in original=" << phb->getNoOfChildren();
-                BasicNode * bn=phb->getFirstChild();            
-                bn->setValue("Axis");
-                cout << endl << "First Child Value=" << bn->getValue();
-                BasicNode *bn1=cl->getFirstChild();
-                BasicNode *bn2=cl->getLastChild();              
-                cout << endl << "First Child Value in clone=" << bn1->getValue();
-                cout << endl << "Last Child Name in clone=" << bn2->getLocalName();
-                op = "add";
-                i1 = 2;
-                i2 = 3;
-                if (strcmp(op, "add") == 0)
-                {
-                        iResult = ws.add(i1, i2);
-                        cout << endl << iResult << endl;
-                }
-                bSuccess = true;
+            if (argc > 1)
+                url = argv[1];
+            sprintf(endpoint, "%s", url);
+            Calculator ws(endpoint);
+            phb=ws.createSOAPHeaderBlock("TestHeader","http://apache.com","np");
+            phb->createImmediateChild(CHARACTER_NODE,"","","","Test Message");
+            cl=phb->clone();
+            cl->createImmediateChild(ELEMENT_NODE,"Name","","","");
+            cout << "No of Child in clone=" << cl->getNoOfChildren();
+            cout << endl << "No of Child in original=" << phb->getNoOfChildren();
+            bn=phb->getFirstChild();
+            bn->setValue("Axis");
+            cout << endl << "First Child Value=" << bn->getValue();
+            bn1=cl->getFirstChild();
+            bn2=cl->getLastChild();
+            cout << endl << "First Child Value in clone=" << bn1->getValue();
+            cout << endl << "Last Child Name in clone=" << bn2->getLocalName();
+            op = "add";
+            i1 = 2;
+            i2 = 3;
+            if (strcmp(op, "add") == 0)
+            {
+                iResult = ws.add(i1, i2);
+                cout << endl << iResult << endl;
+            }
+            bSuccess = true;
         }
         catch(AxisException& e)
         {
-                        bool bSilent = false;
+            bool bSilent = false;
 
-                        if( e.getExceptionCode() == CLIENT_TRANSPORT_OPEN_CONNECTION_FAILED)
-                        {
-                                if( iRetryIterationCount > 0)
-                                {
-                                        bSilent = true;
-                                }
-                        }
-                        else
-                        {
-                                iRetryIterationCount = 0;
-                        }
+            if( e.getExceptionCode() == CLIENT_TRANSPORT_OPEN_CONNECTION_FAILED)
+            {
+                if( iRetryIterationCount > 0)
+                    bSilent = true;
+            }
+            else
+                iRetryIterationCount = 0;
 
             if( !bSilent)
-                        {
-                                cout << "Exception : " << e.what() << endl;
-                        }
+                cout << "Exception : " << e.what() << endl;
         }
         catch(exception& e)
         {
-                cout << "Unknown exception has occured" << endl;
+            cout << "Unknown exception has occured" << endl;
         }
         catch(...)
         {
-                cout << "Unspecified exception has occured" << endl;
+            cout << "Unspecified exception has occured" << endl;
         }
-                iRetryIterationCount--;
-                } while( iRetryIterationCount > 0 && !bSuccess);
-        cout<< "---------------------- TEST COMPLETE -----------------------------"<< endl;     
-        return 0;
+        iRetryIterationCount--;
+    } 
+    while( iRetryIterationCount > 0 && !bSuccess);
+    
+    cout<< "---------------------- TEST COMPLETE -----------------------------"<< endl;
+    return 0;
 }

Modified: webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/IHeaderBlockTest7Client.cpp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/IHeaderBlockTest7Client.cpp?rev=406955&r1=406954&r2=406955&view=diff
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/IHeaderBlockTest7Client.cpp (original)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/IHeaderBlockTest7Client.cpp Tue May 16 07:29:33 2006
@@ -17,6 +17,14 @@
 /* Tests addChild() API in IHeaderBlock
   Author @James Jose  
 */
+/* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! */
+/* 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 "Calculator.hpp"
 #include <axis/IHeaderBlock.hpp>
@@ -27,64 +35,68 @@
 
 int main(int argc, char* argv[])
 {
-        char endpoint[256];
-        const char* url="http://localhost:80/axis/Calculator";
-        int i1=2, i2=3;
-        int iResult;
+    char endpoint[256];
+    const char* url="http://localhost:80/axis/Calculator";
+    int i1=2, i2=3;
+    int iResult;
+
+    bool bSuccess = false;
+    int     iRetryIterationCount = 3;
+    
+    AxisChar *uri="http://ws.apache.org/";   
+    IHeaderBlock *phb; 
+    BasicNode * Bnode1, * Bnode2;
 
-        if(argc > 1)
-                url = argv[1];
-
-                bool bSuccess = false;
-                int     iRetryIterationCount = 3;
-
-                do
-                {
+    do
+    {
         try
         {
-                sprintf(endpoint, "%s", url);
-                Calculator ws(endpoint);
-                AxisChar *uri="http://ws.apache.org/";
-                IHeaderBlock *phb = ws.createSOAPHeaderBlock("TestHeader","http://ws.apache.org/");             
-                BasicNode * Bnode1=phb->createChild(CHARACTER_NODE,NULL,NULL,NULL,"APACHE ");
-                phb->addChild(Bnode1);
-                BasicNode * Bnode2=phb->createChild(CHARACTER_NODE,NULL,NULL,NULL,"is cool");
-                phb->addChild(Bnode2);
-                iResult=ws.add(i1, i2);                 
-                cout << endl << iResult << endl;
-                bSuccess = true;
+            if(argc > 1)
+                url = argv[1];
+            sprintf(endpoint, "%s", url);
+            Calculator ws(endpoint);
+
+            phb = ws.createSOAPHeaderBlock("TestHeader","http://ws.apache.org/");
+            Bnode1=phb->createChild(CHARACTER_NODE,NULL,NULL,NULL,"APACHE ");
+            phb->addChild(Bnode1);
+            Bnode2=phb->createChild(CHARACTER_NODE,NULL,NULL,NULL,"is cool");
+            phb->addChild(Bnode2);
+            iResult=ws.add(i1, i2);
+            cout << endl << iResult << endl;
+            
+            bSuccess = true;
         }
         catch(AxisException& e)
         {
-                        bool bSilent = false;
+            bool bSilent = false;
 
-                        if( e.getExceptionCode() == CLIENT_TRANSPORT_OPEN_CONNECTION_FAILED)
-                        {
-                                if( iRetryIterationCount > 0)
-                                {
-                                        bSilent = true;
-                                }
-                        }
-                        else
-                        {
-                                iRetryIterationCount = 0;
-                        }
+            if( e.getExceptionCode() == CLIENT_TRANSPORT_OPEN_CONNECTION_FAILED)
+            {
+                if( iRetryIterationCount > 0)
+                {
+                    bSilent = true;
+                }
+            }
+            else
+            {
+                iRetryIterationCount = 0;
+            }
 
             if( !bSilent)
-                        {
-                                cout << "Exception : " << e.what() << endl;
-                        }
+            {
+                cout << "Exception : " << e.what() << endl;
+            }
         }
         catch(exception& e)
         {
-                cout << "Unknown exception has occured" << endl;
+            cout << "Unknown exception has occured" << endl;
         }
         catch(...)
         {
-                cout << "Unspecified exception has occured" << endl;
+            cout << "Unspecified exception has occured" << endl;
         }
-                iRetryIterationCount--;
-                } while( iRetryIterationCount > 0 && !bSuccess);
-        cout<< "---------------------- TEST COMPLETE -----------------------------"<< endl;     
-        return 0;
+        iRetryIterationCount--;
+    } while( iRetryIterationCount > 0 && !bSuccess);
+    cout<< "---------------------- TEST COMPLETE -----------------------------"<< endl;
+    return 0;
 }

Modified: webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/IHeaderBlockTest8Client.cpp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/IHeaderBlockTest8Client.cpp?rev=406955&r1=406954&r2=406955&view=diff
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/IHeaderBlockTest8Client.cpp (original)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/IHeaderBlockTest8Client.cpp Tue May 16 07:29:33 2006
@@ -17,6 +17,15 @@
    Author @ James Jose
 */
 
+/* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! */
+/* 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 "Calculator.hpp"
 #include <axis/IHeaderBlock.hpp>
 #include <axis/AxisException.hpp>
@@ -25,83 +34,86 @@
 
 int main(int argc, char* argv[])
 {
-        char endpoint[256];
-        const char* url="http://localhost:80/axis/Calculator";
-        int i1=0, i2=0;
-        int iResult;
-
-        if(argc>1)
-                url = argv[1];
+    char endpoint[256];
+    const char* url="http://localhost:80/axis/Calculator";
+    int i1=0, i2=0;
+    int iResult;
+
+    bool bSuccess = false;
+    int     iRetryIterationCount = 3;
+    
+    IHeaderBlock *phb, *phb1, *phb2, *phb3;
+    IAttribute *attr, *attr1, *attr2, *attr3;
 
-                bool bSuccess = false;
-                int     iRetryIterationCount = 3;
-
-                do
-                {
+    do
+    {
         try
         {
-                sprintf(endpoint, "%s", url);
-                Calculator ws(endpoint);
-                i1 = 2;
-                i2 = 3; 
-                IHeaderBlock *phb = ws.createSOAPHeaderBlock("TestHeader","http://ws.apache.org/");
-                IAttribute *attr = phb->createStdAttribute(ACTOR,SOAP_VER_1_1);
-                cout << attr->getLocalName() << " = " << attr->getValue()<<endl;
-                iResult=ws.add(i1, i2); 
-                cout << iResult << endl;
-                Calculator ws1(endpoint);
-                IHeaderBlock *phb1 = ws1.createSOAPHeaderBlock("TestHeader","http://ws.apache.org/");
-                IAttribute *attr1 = phb1->createStdAttribute(MUST_UNDERSTAND_TRUE,SOAP_VER_1_1);                
-                cout << attr1->getLocalName() << " = " << attr1->getValue()<<endl;
-                iResult=ws1.add(i1, i2);        
-                cout << iResult << endl;
-                Calculator ws2(endpoint);
-                IHeaderBlock *phb2 = ws2.createSOAPHeaderBlock("TestHeader","http://ws.apache.org/");
-                IAttribute *attr2 = phb2->createStdAttribute(MUST_UNDERSTAND_FALSE,SOAP_VER_1_1);
-                cout << attr2->getLocalName() << " = " << attr2->getValue()<<endl;
-                iResult=ws2.add(i1, i2);        
-                cout << iResult << endl;
-                Calculator ws3(endpoint);
-                IHeaderBlock *phb3 = ws3.createSOAPHeaderBlock("TestHeader","http://ws.apache.org/");
-                IAttribute *attr3 = phb3->createStdAttribute(ROLE_NEXT,SOAP_VER_1_1);
-                if(attr3==NULL)
-                  cout << "Null returned for non supporting standard attribute " << endl;
-                iResult=ws3.add(i1, i2);        
-                cout << iResult << endl;
-                bSuccess = true;
+            if(argc>1)
+                url = argv[1];
+            sprintf(endpoint, "%s", url);
+            Calculator ws(endpoint);
+            i1 = 2;
+            i2 = 3;
+            phb = ws.createSOAPHeaderBlock("TestHeader","http://ws.apache.org/");
+            attr = phb->createStdAttribute(ACTOR,SOAP_VER_1_1);
+            cout << attr->getLocalName() << " = " << attr->getValue()<<endl;
+            
+            iResult=ws.add(i1, i2);
+            cout << iResult << endl;
+            
+            Calculator ws1(endpoint);
+            phb1 = ws1.createSOAPHeaderBlock("TestHeader","http://ws.apache.org/");
+            attr1 = phb1->createStdAttribute(MUST_UNDERSTAND_TRUE,SOAP_VER_1_1);
+            cout << attr1->getLocalName() << " = " << attr1->getValue()<<endl;
+            iResult=ws1.add(i1, i2);
+            cout << iResult << endl;
+            
+            Calculator ws2(endpoint);
+            phb2 = ws2.createSOAPHeaderBlock("TestHeader","http://ws.apache.org/");
+            attr2 = phb2->createStdAttribute(MUST_UNDERSTAND_FALSE,SOAP_VER_1_1);
+            cout << attr2->getLocalName() << " = " << attr2->getValue()<<endl;            
+            iResult=ws2.add(i1, i2);
+            cout << iResult << endl;
+            
+            Calculator ws3(endpoint);
+            phb3 = ws3.createSOAPHeaderBlock("TestHeader","http://ws.apache.org/");
+            attr3 = phb3->createStdAttribute(ROLE_NEXT,SOAP_VER_1_1);
+            if(attr3==NULL)
+                cout << "Null returned for non supporting standard attribute " << endl;
+            iResult=ws3.add(i1, i2);
+            cout << iResult << endl;
+            
+            bSuccess = true;
         }
         catch(AxisException& e)
         {
-                        bool bSilent = false;
+            bool bSilent = false;
 
-                        if( e.getExceptionCode() == CLIENT_TRANSPORT_OPEN_CONNECTION_FAILED)
-                        {
-                                if( iRetryIterationCount > 0)
-                                {
-                                        bSilent = true;
-                                }
-                        }
-                        else
-                        {
-                                iRetryIterationCount = 0;
-                        }
+            if( e.getExceptionCode() == CLIENT_TRANSPORT_OPEN_CONNECTION_FAILED)
+            {
+                if( iRetryIterationCount > 0)
+                    bSilent = true;
+            }
+            else
+                iRetryIterationCount = 0;
 
             if( !bSilent)
-                        {
-                                cout << "Exception : " << e.what() << endl;
-                        }
+                cout << "Exception : " << e.what() << endl;
         }
         catch(exception& e)
         {
-                cout << "Unknown exception has occured" << endl;
+            cout << "Unknown exception has occured" << endl;
         }
         catch(...)
         {
-                cout << "Unspecified exception has occured" << endl;
+            cout << "Unspecified exception has occured" << endl;
         }
-                iRetryIterationCount--;
-                } while( iRetryIterationCount > 0 && !bSuccess);
-        cout<< "---------------------- TEST COMPLETE -----------------------------"<< endl;     
-        return 0;
+        iRetryIterationCount--;
+    } 
+    while( iRetryIterationCount > 0 && !bSuccess);
+    
+    cout<< "---------------------- TEST COMPLETE -----------------------------"<< endl;
+    return 0;
 }