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/04/28 05:34:53 UTC
svn commit: r397752 [2/2] -
/webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/
Modified: webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/CombinedAllTestClient.cpp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/CombinedAllTestClient.cpp?rev=397752&r1=397751&r2=397752&view=diff
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/CombinedAllTestClient.cpp (original)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/CombinedAllTestClient.cpp Thu Apr 27 20:34:51 2006
@@ -26,99 +26,94 @@
int returnValue = 1; // Assume Failure
- if (argc > 1)
+ if (argc > 1)
{
- // Watch for special case help request
- if (!strncmp (argv[1], "-", 1)) // Check for - only so that it works for
- //-?, -h or --help; -anything
- {
- usage (argv[0], endpoint);
- return 2;
- }
- sprintf (endpoint, argv[1]);
+ // Watch for special case help request
+ if (!strncmp (argv[1], "-", 1)) // Check for - only so that it works for
+ //-?, -h or --help; -anything
+ {
+ usage (argv[0], endpoint);
+ return 2;
}
+ sprintf (endpoint, argv[1]);
+ }
- bool bSuccess = false;
+ bool bSuccess = false;
int iRetryIterationCount = 3;
- do
+ do
{
- try
- {
- AllTestSoap ws (endpoint, APTHTTP1_1);
- AllComplexType* inParam = new AllComplexType();
-
- inParam->NonAllIntValue = 3;
- inParam->Value0 = new int;
- *(inParam->Value0) = 5;
- inParam->Value2 = "TINTIN";
- inParam->NonAllStringValue = "HELLO";
-
- printf("\nSending.................");
- printf("\nNonAllIntValue = %d",inParam->NonAllIntValue);
- printf("\nAllValue0 = %d",*(inParam->Value0));
- printf("\nAllValue2 = %s",inParam->Value2);
- printf("\nNonAllStringValue = %s",inParam->NonAllStringValue);
-
- ws.setTransportProperty("SOAPAction" , "CombinedAll#echoAll");
- AllComplexType* outParam = ws.echoAll(inParam);
-
- if (outParam != NULL)
- {
- printf("\n\nReceived................");
- printf("\nNonAllIntValue = %d",outParam->NonAllIntValue);
- printf("\nAllValue0 = %d",*(outParam->Value0));
- printf("\nAllValue2 = %s",outParam->Value2);
- printf("\nNonAllStringValue = %s",outParam->NonAllStringValue);
- printf("\n\nSuccessfull\n");
- }
- else
- printf("\nFault\n");
-
- bSuccess = true;
- delete inParam;
- delete outParam;
- }
- catch (AxisException & e)
- {
- bool bSilent = false;
-
- if (e.getExceptionCode () ==
- CLIENT_TRANSPORT_OPEN_CONNECTION_FAILED)
- {
- if (iRetryIterationCount > 0)
- {
- bSilent = true;
- }
- }
- else
- {
- iRetryIterationCount = 0;
- }
-
- if (!bSilent)
- {
- printf ("%s\n", e.what ());
- }
- }
- catch (exception & e)
- {
- printf ("%s\n", e.what ());
- }
- catch (...)
- {
- cout << "Unknown Exception occured." << endl;
- }
+ try
+ {
+ AllTestSoap ws (endpoint, APTHTTP1_1);
+ AllComplexType* inParam = new AllComplexType();
+
+ inParam->NonAllIntValue = 3;
+ inParam->Value0 = new int;
+ *(inParam->Value0) = 5;
+ inParam->Value2 = "TINTIN";
+ inParam->NonAllStringValue = "HELLO";
+
+ printf("\nSending.................");
+ printf("\nNonAllIntValue = %d",inParam->NonAllIntValue);
+ printf("\nAllValue0 = %d",*(inParam->Value0));
+ printf("\nAllValue2 = %s",inParam->Value2);
+ printf("\nNonAllStringValue = %s",inParam->NonAllStringValue);
+
+ ws.setTransportProperty("SOAPAction" , "CombinedAll#echoAll");
+ AllComplexType* outParam = ws.echoAll(inParam);
+
+ if (outParam != NULL)
+ {
+ printf("\n\nReceived................");
+ printf("\nNonAllIntValue = %d",outParam->NonAllIntValue);
+ printf("\nAllValue0 = %d",*(outParam->Value0));
+ printf("\nAllValue2 = %s",outParam->Value2);
+ printf("\nNonAllStringValue = %s",outParam->NonAllStringValue);
+ printf("\n\nSuccessfull\n");
+ }
+ else
+ printf("\nFault\n");
+
+ bSuccess = true;
+ delete inParam;
+ delete outParam;
+ }
+ catch (AxisException & e)
+ {
+ bool bSilent = false;
+
+ if (e.getExceptionCode () ==
+ CLIENT_TRANSPORT_OPEN_CONNECTION_FAILED)
+ {
+ if (iRetryIterationCount > 0)
+ bSilent = true;
+ }
+ else
+ iRetryIterationCount = 0;
+
+ if (!bSilent)
+ printf ("%s\n", e.what ());
+ }
+ catch (exception & e)
+ {
+ printf ("%s\n", e.what ());
+ }
+ catch (...)
+ {
+ cout << "Unknown Exception occured." << endl;
+ }
- iRetryIterationCount--;
+ iRetryIterationCount--;
- }while (iRetryIterationCount > 0 && !bSuccess);
+ }
+ while (iRetryIterationCount > 0 && !bSuccess);
fflush(stdout); // Need to flush output from printf's before cout
cout <<
- "---------------------- TEST COMPLETE -----------------------------"
- << endl;
-
- return returnValue;
+ "---------------------- TEST COMPLETE -----------------------------"
+ << endl;
+
+ return returnValue;
}
Modified: webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/CombinedChoiceClient.cpp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/CombinedChoiceClient.cpp?rev=397752&r1=397751&r2=397752&view=diff
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/CombinedChoiceClient.cpp (original)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/CombinedChoiceClient.cpp Thu Apr 27 20:34:51 2006
@@ -5,33 +5,34 @@
int main(int argc, char *argv[])
{
-
- try
- {
- const char* url="http://localhost:80/axis/CombinedChoice";
- ChoiceComplexType* Value0=new ChoiceComplexType();
- ChoiceComplexType* Value1;
- Value0->NonChoiceIntValue = 5;
- Value0->IntValue = new int;
- *(Value0->IntValue) = 5;
- Value0->StringValue = NULL;
+
+ try
+ {
+ const char* url="http://localhost:80/axis/CombinedChoice";
+ ChoiceComplexType* Value0=new ChoiceComplexType();
+ ChoiceComplexType* Value1;
+ Value0->NonChoiceIntValue = 5;
+ Value0->IntValue = new int;
+ *(Value0->IntValue) = 5;
+ Value0->StringValue = NULL;
Value0->NonChoiceStringValue = "NonChoiceStringValue";
- if ( argc > 1 )
+ if ( argc > 1 )
url = argv[1];
- ChoiceTestSoap ws(url);
+ ChoiceTestSoap ws(url);
- cout<< "Calling the Service..."<<endl;
-
- Value1=ws.echoChoice(Value0);
+ cout<< "Calling the Service..."<<endl;
- cout<<"Value1->NonChoiceIntValue = "<<Value1->NonChoiceIntValue<<endl;
- cout<<"Value1->IntValue = "<<*(Value1->IntValue)<<endl;
- cout<<"Value1->NonChoiceStringValue = "<<Value1->NonChoiceStringValue<<endl;
+ Value1=ws.echoChoice(Value0);
+ cout<<"Value1->NonChoiceIntValue = "<<Value1->NonChoiceIntValue<<endl;
+ cout<<"Value1->IntValue = "<<*(Value1->IntValue)<<endl;
+ cout<<"Value1->NonChoiceStringValue = "<<Value1->NonChoiceStringValue<<endl;
- }catch (AxisException & e)
+
+ }
+ catch (AxisException & e)
{
printf ("Exception : %s\n", e.what ());
}
@@ -44,7 +45,7 @@
printf ("Unknown exception has occured\n");
}
- return 0;
+ return 0;
}
Modified: webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/ComplexListsClient.cpp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/ComplexListsClient.cpp?rev=397752&r1=397751&r2=397752&view=diff
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/ComplexListsClient.cpp (original)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/ComplexListsClient.cpp Thu Apr 27 20:34:51 2006
@@ -39,174 +39,149 @@
if(ale)
{
if (ale->errortext)
- {
cout << ale->errortext << endl;
- }
else
- {
cout << "ale->errortext is NULL" << endl;
- }
-
+
if (ale->errorcode)
- {
cout << ale->errorcode << endl;
- }
else
- {
cout << "ale->errorcode is NULL" << endl;
- }
-
- if (ale->attrlist_Ref != NULL)
+
+ if (ale->attrlist_Ref != NULL)
+ {
+ int outputSize =0;
+ namepair ** output =ale->attrlist_Ref->getitem()->get(outputSize);
+ //if (ale->attrlist_Ref->item.m_Array[0] != NULL)
+ if (output[0] != NULL)
+ {
+ if (output[0]->name != NULL)
+ cout << output[0]->name << endl;
+ else
+ cout << "ale->attrlist_Ref->item.m_Array[0]->name is NULL" << endl;
+
+ if (output[0]->m_list_Ref != NULL)
{
- int outputSize =0;
- namepair ** output =ale->attrlist_Ref->getitem()->get(outputSize);
- //if (ale->attrlist_Ref->item.m_Array[0] != NULL)
- if (output[0] != NULL)
- {
- if (output[0]->name != NULL)
- {
- cout << output[0]->name << endl;
- }
- else
- {
- cout << "ale->attrlist_Ref->item.m_Array[0]->name is NULL" << endl;
- }
-
- if (output[0]->m_list_Ref != NULL)
- {
- outputSize = 0;
- const xsd__string * outString = output[0]->m_list_Ref->item->get(outputSize);
- if (outString[0]
- && *(outString[0]))
- {
- cout << outString[0] << endl;
- }
- else
- {
- cout << "ale->attrlist_Ref->item.m_Array[0]->m_list_Ref->item.m_Array[0]" << endl;
- }
- }
- }
+ outputSize = 0;
+ const xsd__string * outString = output[0]->m_list_Ref->item->get(outputSize);
+ if (outString[0] && *(outString[0]))
+ cout << outString[0] << endl;
+ else
+ cout << "ale->attrlist_Ref->item.m_Array[0]->m_list_Ref->item.m_Array[0]" << endl;
}
+ }
+ }
}
else
- {
cout << "Deserialized response is NULL" << endl;
- }
}
int main(int argc, char* argv[])
{
- char endpoint[256];
- const char* url="http://localhost:80/axis/ComplexLists";
+ char endpoint[256];
+ const char* url="http://localhost:80/axis/ComplexLists";
- if(argc>1) url = argv[1];
+ if(argc>1) url = argv[1];
- bool bSuccess = false;
- int iRetryIterationCount = 3;
+ bool bSuccess = false;
+ int iRetryIterationCount = 3;
- do
- {
+ do
+ {
try
{
- sprintf(endpoint, "%s", url);
- ComplexLists* ws = new ComplexLists(endpoint);
+ sprintf(endpoint, "%s", url);
+ ComplexLists* ws = new ComplexLists(endpoint);
- m_list ml; // xsd__string array
- m_list *mlnp = new m_list; // used for 1st namepair item of array
- m_list *mlnp2 = new m_list; // used for 2nd namepair item of array
- attrlist al; // attrlist has namepair array
- namepair *np1 = new namepair; // namepair has m_list and name
- namepair *np2 = new namepair;
- namepair_Array npArr;
-
- // m_list arg to numtilist
- xsd__string * array = new xsd__string[ARRAYSIZE];
- NEWCOPY(array[0], "never odd or even"); // should be returned in errortext element of attrlisterr
- NEWCOPY(array[1], "any data string"); // add data
- ml.item->set(array,ARRAYSIZE);
- delete array[0];
- delete array[1];
- delete [] array;
-
- // To set into namepair item of namepair array of attrlist arg of multilist
- xsd__string * array1 = new xsd__string[ARRAYSIZE];
- NEWCOPY(array1[0], "Apache");
- NEWCOPY(array1[1], "Axis C++");
- mlnp->item->set(array1,ARRAYSIZE);
- delete array1[0];
- delete array1[1];
- delete [] array1;
-
- // To set into namepair item of namepair array of attrlist arg of multilist
- xsd__string * array2 = new xsd__string[ARRAYSIZE];
- NEWCOPY(array2[0], "Test");
- NEWCOPY(array2[1], "Complex");
- mlnp2->item->set(array2,ARRAYSIZE);
- delete array2[0];
- delete array2[1];
- delete [] array2;
-
- // set first namepair item to put into array
- np1->m_list_Ref = mlnp;
- np1->setname("namepair1");
-
- // set second namepair item to put into array
- np2->m_list_Ref = mlnp2;
- np2->setname("namepair2");
-
- // create a namepair array to add into attrlist
- namepair ** nArray = new namepair *[ARRAYSIZE];
- nArray[0]=np1;
- nArray[1]=np2;
- npArr.set(nArray,ARRAYSIZE);
- delete nArray[0];
- delete nArray[1];
- delete [] nArray;
-
- // set attrlist argument
- al.setitem(&npArr);
-
- attrlisterr* ale = ws->multilist(&ml, &al);
- printResponse(ale);
- delete ale;
-
- ale = ws->multilist((m_list*)NULL, &al);
- printResponse(ale);
- delete ale;
-
- // Have nil elements in response
- ale = ws->multilistnil((m_list*)NULL, &al);
- printResponse(ale);
- delete ale;
-
- ale = ws->complexlist(&al, "hoohah!", &al);
- printResponse(ale);
- delete ale;
+ m_list ml; // xsd__string array
+ m_list *mlnp = new m_list; // used for 1st namepair item of array
+ m_list *mlnp2 = new m_list; // used for 2nd namepair item of array
+ attrlist al; // attrlist has namepair array
+ namepair *np1 = new namepair; // namepair has m_list and name
+ namepair *np2 = new namepair;
+ namepair_Array npArr;
+
+ // m_list arg to numtilist
+ xsd__string * array = new xsd__string[ARRAYSIZE];
+ NEWCOPY(array[0], "never odd or even"); // should be returned in errortext element of attrlisterr
+ NEWCOPY(array[1], "any data string"); // add data
+ ml.item->set(array,ARRAYSIZE);
+ delete array[0];
+ delete array[1];
+ delete [] array;
+
+ // To set into namepair item of namepair array of attrlist arg of multilist
+ xsd__string * array1 = new xsd__string[ARRAYSIZE];
+ NEWCOPY(array1[0], "Apache");
+ NEWCOPY(array1[1], "Axis C++");
+ mlnp->item->set(array1,ARRAYSIZE);
+ delete array1[0];
+ delete array1[1];
+ delete [] array1;
+
+ // To set into namepair item of namepair array of attrlist arg of multilist
+ xsd__string * array2 = new xsd__string[ARRAYSIZE];
+ NEWCOPY(array2[0], "Test");
+ NEWCOPY(array2[1], "Complex");
+ mlnp2->item->set(array2,ARRAYSIZE);
+ delete array2[0];
+ delete array2[1];
+ delete [] array2;
+
+ // set first namepair item to put into array
+ np1->m_list_Ref = mlnp;
+ np1->setname("namepair1");
+
+ // set second namepair item to put into array
+ np2->m_list_Ref = mlnp2;
+ np2->setname("namepair2");
+
+ // create a namepair array to add into attrlist
+ namepair ** nArray = new namepair *[ARRAYSIZE];
+ nArray[0]=np1;
+ nArray[1]=np2;
+ npArr.set(nArray,ARRAYSIZE);
+ delete nArray[0];
+ delete nArray[1];
+ delete [] nArray;
+
+ // set attrlist argument
+ al.setitem(&npArr);
+
+ attrlisterr* ale = ws->multilist(&ml, &al);
+ printResponse(ale);
+ delete ale;
+
+ ale = ws->multilist((m_list*)NULL, &al);
+ printResponse(ale);
+ delete ale;
+
+ // Have nil elements in response
+ ale = ws->multilistnil((m_list*)NULL, &al);
+ printResponse(ale);
+ delete ale;
+
+ ale = ws->complexlist(&al, "hoohah!", &al);
+ printResponse(ale);
+ delete ale;
- delete ws;
- bSuccess = true;
+ delete ws;
+ 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)
{
@@ -216,10 +191,12 @@
{
cout << "Unknown 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;
}