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:04:04 UTC
svn commit: r397747 [7/17] -
/webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/
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=397747&r1=397746&r2=397747&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 Thu Apr 27 20:03:51 2006
@@ -27,64 +27,64 @@
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;
- 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
- {
- 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;
- }
- catch(AxisException& e)
- {
- bool bSilent = false;
+ 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;
+ }
+ catch(AxisException& e)
+ {
+ 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;
- }
- }
- catch(exception& e)
- {
- cout << "Unknown exception has occured" << endl;
- }
- catch(...)
- {
- cout << "Unspecified exception has occured" << endl;
- }
- iRetryIterationCount--;
- } while( iRetryIterationCount > 0 && !bSuccess);
- cout<< "---------------------- TEST COMPLETE -----------------------------"<< endl;
- return 0;
+ {
+ cout << "Exception : " << e.what() << endl;
+ }
+ }
+ catch(exception& e)
+ {
+ cout << "Unknown exception has occured" << endl;
+ }
+ catch(...)
+ {
+ cout << "Unspecified exception has occured" << endl;
+ }
+ 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=397747&r1=397746&r2=397747&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 Thu Apr 27 20:03:51 2006
@@ -25,83 +25,83 @@
int main(int argc, char* argv[])
{
- char endpoint[256];
- const char* url="http://localhost:80/axis/Calculator";
- int i1=0, i2=0;
- int iResult;
+ char endpoint[256];
+ const char* url="http://localhost:80/axis/Calculator";
+ int i1=0, i2=0;
+ int iResult;
- 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
- {
- 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;
- }
- catch(AxisException& e)
- {
- bool bSilent = false;
+ 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;
+ }
+ catch(AxisException& e)
+ {
+ 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;
- }
- }
- catch(exception& e)
- {
- cout << "Unknown exception has occured" << endl;
- }
- catch(...)
- {
- cout << "Unspecified exception has occured" << endl;
- }
- iRetryIterationCount--;
- } while( iRetryIterationCount > 0 && !bSuccess);
- cout<< "---------------------- TEST COMPLETE -----------------------------"<< endl;
- return 0;
+ {
+ cout << "Exception : " << e.what() << endl;
+ }
+ }
+ catch(exception& e)
+ {
+ cout << "Unknown exception has occured" << endl;
+ }
+ catch(...)
+ {
+ cout << "Unspecified exception has occured" << endl;
+ }
+ iRetryIterationCount--;
+ } while( iRetryIterationCount > 0 && !bSuccess);
+ cout<< "---------------------- TEST COMPLETE -----------------------------"<< endl;
+ return 0;
}
Modified: webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/INamespaceTest1Client.cpp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/INamespaceTest1Client.cpp?rev=397747&r1=397746&r2=397747&view=diff
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/INamespaceTest1Client.cpp (original)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/INamespaceTest1Client.cpp Thu Apr 27 20:03:51 2006
@@ -25,77 +25,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];
+ 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;
+ bool bSuccess = false;
+ int iRetryIterationCount = 3;
- do
- {
- try
- {
- sprintf(endpoint, "%s", url);
- Calculator ws(endpoint);
- const AxisChar *pf="nsp";
- const AxisChar *uri="http://axis.apache.org";
- IHeaderBlock *phb=ws.createSOAPHeaderBlock("TestHeader","http://apache.org","ns");
- INamespace *nsp=phb->createNamespaceDecl("ns1","http://axis.org");
- cout <<nsp->setURI(NULL)<<endl;
- cout <<nsp->setURI(uri)<<endl;
- cout <<nsp->setPrefix(NULL)<<endl;
- cout <<nsp->setPrefix(pf)<<endl;
- const AxisChar *p=nsp->getPrefix();
- const AxisChar *u=nsp->getURI();
- cout << "Prefix = " << p << endl;
- cout << "Uri = " << u << endl;
- op = "add";
- i1 = 2;
- i2 = 3;
+ do
+ {
+ try
+ {
+ sprintf(endpoint, "%s", url);
+ Calculator ws(endpoint);
+ const AxisChar *pf="nsp";
+ const AxisChar *uri="http://axis.apache.org";
+ IHeaderBlock *phb=ws.createSOAPHeaderBlock("TestHeader","http://apache.org","ns");
+ INamespace *nsp=phb->createNamespaceDecl("ns1","http://axis.org");
+ cout <<nsp->setURI(NULL)<<endl;
+ cout <<nsp->setURI(uri)<<endl;
+ cout <<nsp->setPrefix(NULL)<<endl;
+ cout <<nsp->setPrefix(pf)<<endl;
+ const AxisChar *p=nsp->getPrefix();
+ const AxisChar *u=nsp->getURI();
+ cout << "Prefix = " << p << endl;
+ cout << "Uri = " << u << endl;
+ op = "add";
+ i1 = 2;
+ i2 = 3;
- if (strcmp(op, "add") == 0)
- {
- iResult = ws.add(i1, i2);
- cout << iResult << endl;
- }
- bSuccess = true;
- }
- catch(AxisException& e)
- {
- bool bSilent = false;
+ if (strcmp(op, "add") == 0)
+ {
+ iResult = ws.add(i1, i2);
+ cout << iResult << endl;
+ }
+ bSuccess = true;
+ }
+ catch(AxisException& e)
+ {
+ 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;
- }
- }
- catch(exception& e)
- {
- cout << "Unknown exception has occured" << endl;
- }
- catch(...)
- {
- cout << "Unspecified exception has occured" << endl;
- }
- iRetryIterationCount--;
- } while( iRetryIterationCount > 0 && !bSuccess);
- cout<< "---------------------- TEST COMPLETE -----------------------------"<< endl;
- return 0;
+ {
+ cout << "Exception : " << e.what() << endl;
+ }
+ }
+ catch(exception& e)
+ {
+ cout << "Unknown exception has occured" << endl;
+ }
+ catch(...)
+ {
+ cout << "Unspecified exception has occured" << endl;
+ }
+ iRetryIterationCount--;
+ } while( iRetryIterationCount > 0 && !bSuccess);
+ cout<< "---------------------- TEST COMPLETE -----------------------------"<< endl;
+ return 0;
}
Modified: webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/InOutClient.cpp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/InOutClient.cpp?rev=397747&r1=397746&r2=397747&view=diff
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/InOutClient.cpp (original)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/InOutClient.cpp Thu Apr 27 20:03:51 2006
@@ -37,115 +37,115 @@
int main(int argc, char* argv[])
{
- char endpoint[256];
- const char* url="http://localhost:80/axis/InOut";
+ char endpoint[256];
+ const char* url="http://localhost:80/axis/InOut";
- if(argc>1)
- url = argv[1];
+ if(argc>1)
+ url = argv[1];
- try
- {
- sprintf(endpoint, "%s", url);
- InOut ws(endpoint);
-
- xsd__int_Array int_in;
- xsd__double_Array double_in;
- xsd__string_Array string_in;
- //xsd__double* moDouble;
- //xsd__int* moInt;
- //xsd__string moString;
+ try
+ {
+ sprintf(endpoint, "%s", url);
+ InOut ws(endpoint);
+
+ xsd__int_Array int_in;
+ xsd__double_Array double_in;
+ xsd__string_Array string_in;
+ //xsd__double* moDouble;
+ //xsd__int* moInt;
+ //xsd__string moString;
static char* str1 = "Apache";
static char* str2 = "Axis C++";
- cout << "noParametersNoReturn" << endl;
- ws.noParametersNoReturn();
- cout << "noParametersNoReturn returned" << endl;
-
- cout << "noParametersIntReturn" << endl;
- int npir = ws.noParametersIntReturn();
- cout << "noParametersIntReturn returned " << npir << endl;
-
- cout << "multiParametersNoReturn" << endl;
- ws.multiParametersNoReturn("Hey dude", 69, (xsd__double)17.19);
- cout << "multiParametersNoReturn returned" << endl;
-
-
- // test multiParametersMultiReturn
- xsd__string outValue0 = "";
- xsd__int outValue1 = 0;
- xsd__double outValue2 = 0;
-
- cout << "multiParametersMultiReturn" << endl;
- ws.multiParametersMultiReturn("Hey dude", 69, (xsd__double)17.19, &outValue0, &outValue1, &outValue2);
- cout << "multiParametersMultiReturn returned " << outValue0 << " , " << outValue1 << " , " << outValue2 <<endl;
+ cout << "noParametersNoReturn" << endl;
+ ws.noParametersNoReturn();
+ cout << "noParametersNoReturn returned" << endl;
+
+ cout << "noParametersIntReturn" << endl;
+ int npir = ws.noParametersIntReturn();
+ cout << "noParametersIntReturn returned " << npir << endl;
+
+ cout << "multiParametersNoReturn" << endl;
+ ws.multiParametersNoReturn("Hey dude", 69, (xsd__double)17.19);
+ cout << "multiParametersNoReturn returned" << endl;
+
+
+ // test multiParametersMultiReturn
+ xsd__string outValue0 = "";
+ xsd__int outValue1 = 0;
+ xsd__double outValue2 = 0;
+
+ cout << "multiParametersMultiReturn" << endl;
+ ws.multiParametersMultiReturn("Hey dude", 69, (xsd__double)17.19, &outValue0, &outValue1, &outValue2);
+ cout << "multiParametersMultiReturn returned " << outValue0 << " , " << outValue1 << " , " << outValue2 <<endl;
- //...........................................................
+ //...........................................................
xsd__int ** arrayOfInt = new xsd__int*[3];
- xsd__int_Array intArray;
- arrayOfInt[0] = new xsd__int(37);
- arrayOfInt[1] = new xsd__int(0);
+ xsd__int_Array intArray;
+ arrayOfInt[0] = new xsd__int(37);
+ arrayOfInt[1] = new xsd__int(0);
arrayOfInt[2] = new xsd__int(43);
- intArray.set(arrayOfInt,3);
+ intArray.set(arrayOfInt,3);
- xsd__string_Array stringArray;
- xsd__string * arrayOfString =new xsd__string[3];
- arrayOfString[0]="One";
- arrayOfString[1]="Two";
- arrayOfString[2]="Three";
- stringArray.set(arrayOfString,3);
-
- ComplexType1 ct;
- ct.ctLong = (xsd__long)87654321;
- ct.ctString = "World";
- ct.setctIntArray(&intArray);
-
- cout << "multiComplexParametersIntReturn" << endl;
- int mcpir = ws.multiComplexParametersIntReturn("Hello", &ct, 27, 13.31, &stringArray);
- cout << "multiComplexParametersIntReturn returned " << mcpir << endl;
-
- //test multiComplexParametersMultiComplexReturn
-
- xsd__string OutValue0 = "";
- ComplexType1* OutValue1;
- xsd__int outValue22 = 0;
- xsd__double outValue33 = 0;
-
- cout << "multiComplexParametersMultiComplexReturn" << endl;
- ws.multiComplexParametersMultiComplexReturn("Hello", &ct, 27, 13.31, &stringArray, &OutValue0, &OutValue1, &outValue22, &outValue33);
- cout << "multiComplexParametersMultiComplexReturn returned " << OutValue0 << " , " << OutValue1->ctString << endl;
-
- //..............................................................................
-
-
- arrayOfString[0]="Four";
- arrayOfString[1]=NULL;
- arrayOfString[2]="Six";
- stringArray.set(arrayOfString,3);
+ xsd__string_Array stringArray;
+ xsd__string * arrayOfString =new xsd__string[3];
+ arrayOfString[0]="One";
+ arrayOfString[1]="Two";
+ arrayOfString[2]="Three";
+ stringArray.set(arrayOfString,3);
+
+ ComplexType1 ct;
+ ct.ctLong = (xsd__long)87654321;
+ ct.ctString = "World";
+ ct.setctIntArray(&intArray);
+
+ cout << "multiComplexParametersIntReturn" << endl;
+ int mcpir = ws.multiComplexParametersIntReturn("Hello", &ct, 27, 13.31, &stringArray);
+ cout << "multiComplexParametersIntReturn returned " << mcpir << endl;
+
+ //test multiComplexParametersMultiComplexReturn
+
+ xsd__string OutValue0 = "";
+ ComplexType1* OutValue1;
+ xsd__int outValue22 = 0;
+ xsd__double outValue33 = 0;
+
+ cout << "multiComplexParametersMultiComplexReturn" << endl;
+ ws.multiComplexParametersMultiComplexReturn("Hello", &ct, 27, 13.31, &stringArray, &OutValue0, &OutValue1, &outValue22, &outValue33);
+ cout << "multiComplexParametersMultiComplexReturn returned " << OutValue0 << " , " << OutValue1->ctString << endl;
+
+ //..............................................................................
+
+
+ arrayOfString[0]="Four";
+ arrayOfString[1]=NULL;
+ arrayOfString[2]="Six";
+ stringArray.set(arrayOfString,3);
- ComplexNilType1 cnt;
+ ComplexNilType1 cnt;
xsd__long * longValue = new xsd__long(87654321);
- cnt.ctLong = longValue;
- cnt.ctString = NULL;
- cnt.setctIntArray(&intArray);
-
- cout << "multiComplexParametersNilIntReturn" << endl;
- mcpir = ws.multiComplexParametersNilIntReturn(NULL, &cnt, NULL, NULL, &stringArray);
- cout << "multiComplexParametersNilIntReturn returned " << mcpir << endl;
+ cnt.ctLong = longValue;
+ cnt.ctString = NULL;
+ cnt.setctIntArray(&intArray);
+
+ cout << "multiComplexParametersNilIntReturn" << endl;
+ mcpir = ws.multiComplexParametersNilIntReturn(NULL, &cnt, NULL, NULL, &stringArray);
+ cout << "multiComplexParametersNilIntReturn returned " << mcpir << endl;
delete longValue;
- /* Commented out as there is a bug in WSDL2Ws.
- * AXISCPP-565 is the Jira against this problem.
+ /* Commented out as there is a bug in WSDL2Ws.
+ * AXISCPP-565 is the Jira against this problem.
*
- cout << "noParametersMultiReturn" << endl;
- ws.noParametersMultiReturn(&moDouble, &moInt, &moString);
- cout << "noParametersMultiReturn returned " << *moDouble << " " << *moInt << " " << moString << endl;
- *
- * Removed from WSDL for time being.
- */
+ cout << "noParametersMultiReturn" << endl;
+ ws.noParametersMultiReturn(&moDouble, &moInt, &moString);
+ cout << "noParametersMultiReturn returned " << *moDouble << " " << *moInt << " " << moString << endl;
+ *
+ * Removed from WSDL for time being.
+ */
xsd__int ** arrayOfInt2 = new xsd__int*[ARRAYSIZE];
int x = 0;
@@ -154,7 +154,7 @@
arrayOfInt2[x] = new xsd__int(x+1);
}
- int_in.set(arrayOfInt2,ARRAYSIZE);
+ int_in.set(arrayOfInt2,ARRAYSIZE);
xsd__double ** arrayOfDouble = new xsd__double*[ARRAYSIZE];
@@ -163,49 +163,49 @@
arrayOfDouble[x] = new xsd__double((xsd__double)x+71.15656);
}
- double_in.set(arrayOfDouble,ARRAYSIZE);
+ double_in.set(arrayOfDouble,ARRAYSIZE);
xsd__string * arrayOfString2 = new xsd__string[ARRAYSIZE];
arrayOfString2[0] = str1;
arrayOfString2[1] = str2;
- string_in.set(arrayOfString2,ARRAYSIZE);
- cout << "multiArrayParametersIntReturn" << endl;
- int mapir = ws.multiArrayParametersIntReturn(&int_in, &double_in, &string_in);
- cout << "multiArrayParametersIntReturn returned " << mapir << endl;
-
- ComplexType2 ct2;
- ct2.ctLong = (xsd__long)98765432;
- ct2.setctIntArray(&intArray);
- ct2.ctString = "Complex2";
- ct2.ctComplex = &ct;
-
- cout << "complexParameterComplexReturn" << endl;
- ComplexType2* ctr = ws.complexParameterComplexReturn(&ct2);
- cout << "complexParameterComplexReturn returned " << ctr->ctString << endl;
-
- ct2.ctLong = (xsd__long)22222222;
- ct2.ctString = NULL;
- ct2.ctComplex = NULL;
-
- cout << "complexParameterComplexReturn with nil parameters" << endl;
- ctr = ws.complexParameterComplexReturn(&ct2);
- cout << "complexParameterComplexReturn with nil parameters returned " << ctr->ctLong << endl;
-
- }
- 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;
+ string_in.set(arrayOfString2,ARRAYSIZE);
+ cout << "multiArrayParametersIntReturn" << endl;
+ int mapir = ws.multiArrayParametersIntReturn(&int_in, &double_in, &string_in);
+ cout << "multiArrayParametersIntReturn returned " << mapir << endl;
+
+ ComplexType2 ct2;
+ ct2.ctLong = (xsd__long)98765432;
+ ct2.setctIntArray(&intArray);
+ ct2.ctString = "Complex2";
+ ct2.ctComplex = &ct;
+
+ cout << "complexParameterComplexReturn" << endl;
+ ComplexType2* ctr = ws.complexParameterComplexReturn(&ct2);
+ cout << "complexParameterComplexReturn returned " << ctr->ctString << endl;
+
+ ct2.ctLong = (xsd__long)22222222;
+ ct2.ctString = NULL;
+ ct2.ctComplex = NULL;
+
+ cout << "complexParameterComplexReturn with nil parameters" << endl;
+ ctr = ws.complexParameterComplexReturn(&ct2);
+ cout << "complexParameterComplexReturn with nil parameters returned " << ctr->ctLong << endl;
+
+ }
+ 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;
}
Modified: webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/InteropTestRound1Client.cpp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/InteropTestRound1Client.cpp?rev=397747&r1=397746&r2=397747&view=diff
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/InteropTestRound1Client.cpp (original)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/InteropTestRound1Client.cpp Thu Apr 27 20:03:51 2006
@@ -22,445 +22,445 @@
#include "InteropTestPortType.hpp"
#include "CommonClientTestCode.hpp"
-#define ARRAYSIZE 2
-#define macro_ToTwoDecPlaces( value, type) (type)(((int)(value * (type) 100.0))) / ((type) 100.0)
-#define macro_BoolToString( value) (value == true_ ? "true" : "false")
+#define ARRAYSIZE 2
+#define macro_ToTwoDecPlaces( value, type) (type)(((int)(value * (type) 100.0))) / ((type) 100.0)
+#define macro_BoolToString( value) (value == true_ ? "true" : "false")
int main( int argc, char * argv[])
{
- char buffer1[100];
- char buffer2[100];
- char endpoint[256];
-
- if( argc > 1)
- {
- strcpy( endpoint, argv[1]);
- }
- else
- {
- const char * server = "localhost";
- const char * port = "80";
-
- sprintf( endpoint, "http://%s:%s/axis/InteropBase", server, port);
- }
-
- bool bSuccess = false;
- int iRetryIterationCount = 3;
-
- do
- {
- try
+ char buffer1[100];
+ char buffer2[100];
+ char endpoint[256];
+
+ if( argc > 1)
{
- InteropTestPortType ws( endpoint, APTHTTP1_1);
+ strcpy( endpoint, argv[1]);
+ }
+ else
+ {
+ const char * server = "localhost";
+ const char * port = "80";
+
+ sprintf( endpoint, "http://%s:%s/axis/InteropBase", server, port);
+ }
+
+ bool bSuccess = false;
+ int iRetryIterationCount = 3;
+
+ do
+ {
+ try
+ {
+ InteropTestPortType ws( endpoint, APTHTTP1_1);
- ws.setTransportTimeout( 5);
- ws.setTransportProperty( "SOAPAction", "InteropBase#echoString");
+ ws.setTransportTimeout( 5);
+ ws.setTransportProperty( "SOAPAction", "InteropBase#echoString");
- cout << "invoking echoString..." << endl;
+ cout << "invoking echoString..." << endl;
//testing echoString
- string bigString;
+ string bigString;
- for (int ii = 0; ii < 2; ii++)
- {
- bigString += "hello world ";
- }
-
- strcpy( buffer1, bigString.c_str());
-
- ws.setTransportProperty( "SOAPAction", "InteropBase#echoString");
-
- cout << ws.echoString( buffer1) << endl;
-
- xsd__string retString = ws.echoString( "hello world");
- xsd__string expString = "hello world";
-
- if( 0 == strcmp( retString, expString))
- {
- cout << "successful" << endl;
- }
- else
- {
- cout << "Failed. The returned string (" << retString << ") was not the same as the expected string(" << expString << ")." << endl;
- }
+ for (int ii = 0; ii < 2; ii++)
+ {
+ bigString += "hello world ";
+ }
+
+ strcpy( buffer1, bigString.c_str());
+
+ ws.setTransportProperty( "SOAPAction", "InteropBase#echoString");
+
+ cout << ws.echoString( buffer1) << endl;
+
+ xsd__string retString = ws.echoString( "hello world");
+ xsd__string expString = "hello world";
+
+ if( 0 == strcmp( retString, expString))
+ {
+ cout << "successful" << endl;
+ }
+ else
+ {
+ cout << "Failed. The returned string (" << retString << ") was not the same as the expected string(" << expString << ")." << endl;
+ }
// testing echoStringArray
- xsd__string_Array arrstr;
- xsd__string * sToSend = new xsd__string[ARRAYSIZE];
+ xsd__string_Array arrstr;
+ xsd__string * sToSend = new xsd__string[ARRAYSIZE];
- sprintf( buffer1, "%dth element of string array", 0);
- sprintf( buffer2, "%dst element of string array", 1);
+ sprintf( buffer1, "%dth element of string array", 0);
+ sprintf( buffer2, "%dst element of string array", 1);
- sToSend[0]= buffer1;
- sToSend[1]= buffer2;
+ sToSend[0]= buffer1;
+ sToSend[1]= buffer2;
- arrstr.set( sToSend, ARRAYSIZE);
-
- ws.setTransportProperty( "SOAPAction", "InteropBase#echoStringArray");
-
- cout << "invoking echoStringArray..." << endl;
-
- int outputSize = 0;
- xsd__string_Array * outPutStrArray = ws.echoStringArray( &arrstr);
-
- if( outPutStrArray != NULL &&
- outPutStrArray->get( outputSize) != NULL &&
- outputSize == ARRAYSIZE)
- {
- cout << "successful" << endl;
- }
- else
- {
- cout << "Failed. outputsize=" << outputSize << endl;
- }
+ arrstr.set( sToSend, ARRAYSIZE);
+
+ ws.setTransportProperty( "SOAPAction", "InteropBase#echoStringArray");
+
+ cout << "invoking echoStringArray..." << endl;
+
+ int outputSize = 0;
+ xsd__string_Array * outPutStrArray = ws.echoStringArray( &arrstr);
+
+ if( outPutStrArray != NULL &&
+ outPutStrArray->get( outputSize) != NULL &&
+ outputSize == ARRAYSIZE)
+ {
+ cout << "successful" << endl;
+ }
+ else
+ {
+ cout << "Failed. outputsize=" << outputSize << endl;
+ }
// testing echoInteger
- ws.setTransportProperty("SOAPAction" , "InteropBase#echoInteger");
+ ws.setTransportProperty("SOAPAction" , "InteropBase#echoInteger");
- cout << "invoking echoInteger..." << endl;
+ cout << "invoking echoInteger..." << endl;
- xsd__int expInt = 56;
- xsd__integer retInt = ws.echoInteger( expInt);
+ xsd__int expInt = 56;
+ xsd__integer retInt = ws.echoInteger( expInt);
- if( retInt == expInt)
- {
- cout << "successful" << endl;
- }
- else
- {
- cout << "Failed. The returned integer (" << retInt << ") was not the same as the expected integer (" << expInt << ")." << endl;
- }
-
- // testing echoIntegerArray
- xsd__int_Array arrint;
- xsd__int ** iToSend = new xsd__int*[ARRAYSIZE];
+ if( retInt == expInt)
+ {
+ cout << "successful" << endl;
+ }
+ else
+ {
+ cout << "Failed. The returned integer (" << retInt << ") was not the same as the expected integer (" << expInt << ")." << endl;
+ }
+
+ // testing echoIntegerArray
+ xsd__int_Array arrint;
+ xsd__int ** iToSend = new xsd__int*[ARRAYSIZE];
int count;
- for( count = 0; count < ARRAYSIZE; count++)
- {
- iToSend[count] = new xsd__int(count);
- }
-
- arrint.set( iToSend, ARRAYSIZE);
-
- ws.setTransportProperty( "SOAPAction" , "InteropBase#echoIntegerArray");
-
- cout << "invoking echoIntegerArray..." << endl;
-
- outputSize = 0;
-
- xsd__int_Array * outPutIntArray = ws.echoIntegerArray( &arrint);
-
- if( outPutIntArray != NULL &&
- outPutIntArray->get( outputSize) != NULL &&
- outputSize == ARRAYSIZE)
- {
- cout << "successful" << endl;
- }
- else
- {
- cout << "Failed. outputsize=" << outputSize << endl;
- }
-
- // testing echoFloat
- cout << "invoking echoFloat..." << endl;
-
- float fvalue = (float) 1.4214;
-
- ws.setTransportProperty( "SOAPAction", "InteropBase#echoFloat");
-
- xsd__float retFloat = ws.echoFloat( fvalue);
- xsd__float expFloat = macro_ToTwoDecPlaces( fvalue, float);
-
- if( retFloat > expFloat)
- {
- cout << "successful" << endl;
- }
- else
- {
- cout << "Failed. The returned float (" << retFloat << ") was not the same as the expected float (" << expFloat << ")." << endl;
- }
-
- // testing echoFloatArray
- xsd__float_Array arrfloat;
- xsd__float ** fToSend = new xsd__float*[ARRAYSIZE];
-
- for( count = 0; count < ARRAYSIZE; count++)
- {
- fToSend[count] = new xsd__float( (xsd__float) 1.1111 * (xsd__float) count);
- }
-
- arrfloat.set( fToSend, ARRAYSIZE);
-
- ws.setTransportProperty( "SOAPAction", "InteropBase#echoFloatArray");
-
- cout << "invoking echoFloatArray..." << endl;
-
- outputSize = 0;
-
- xsd__float_Array * outPutFloatArray = ws.echoFloatArray( &arrfloat);
-
- if( outPutFloatArray != NULL &&
- outPutFloatArray->get( outputSize) != NULL &&
- outputSize == ARRAYSIZE)
- {
- cout << "successful" << endl;
- }
- else
- {
- cout << "Failed. outputsize=" << outputSize << endl;
- }
-
- // testing echo Struct
- SOAPStruct stct;
-
- stct.varFloat = new float;
- stct.varInt = new int;
-
- *(stct.varFloat) = (xsd__float) 12345.7346345;
- *(stct.varInt) = 5000;
-
- stct.varString = strdup( "This is string in SOAPStruct");
-
- cout << "invoking echoStruct..." << endl;
-
- ws.setTransportProperty( "SOAPAction", "InteropBase#echoStruct");
-
- if( ws.echoStruct( &stct) != NULL)
- {
- cout << "successful" << endl;
- }
- else
- {
- cout << "Failed. The deserialised structure was null." << endl;
- }
-
- //testing echo Array of Struct
- SOAPStruct_Array arrstct;
- SOAPStruct ** m_Array4 = new SOAPStruct *[ARRAYSIZE];
- SOAPStruct ssToSend[ARRAYSIZE];
- xsd__float myFloat;
-
- for( count = 0; count < ARRAYSIZE; count++)
- {
- myFloat = (xsd__float) (1.1111 * count);
-
- ssToSend[count].setvarFloat( &myFloat);
- ssToSend[count].setvarInt( &count);
-
- sprintf( buffer1, "varString of %dth element of SOAPStruct array", count);
-
- ssToSend[count].setvarString( buffer1);
-
- m_Array4[count] = &ssToSend[count];
- }
-
- arrstct.set( m_Array4, ARRAYSIZE);
-
- //testing echo Struct Array
- ws.setTransportProperty( "SOAPAction", "InteropBase#echoStructArray");
-
- cout << "invoking echoStructArray..." << endl;
-
- SOAPStruct_Array * outPutStructArray = ws.echoStructArray( &arrstct);
-
- if( outPutStructArray != NULL)
- {
- outputSize = 0;
-
- SOAPStruct ** ppSOAPStruct = outPutStructArray->get( outputSize);
-
- if( ppSOAPStruct != NULL && outputSize == ARRAYSIZE)
- {
- cout << "successful" << endl;
- }
- else
- {
- cout << "Failed. outputsize = " << outputSize << endl;
-
- for( int iIndex = 0; iIndex < outputSize; iIndex++)
- {
- cout << "Failed(" << iIndex << ") varString = \"" << ppSOAPStruct[iIndex]->getvarString() << "\", varInt = " << *ppSOAPStruct[iIndex]->getvarInt() << ", varFloat = " << *ppSOAPStruct[iIndex]->getvarFloat() << endl;
- }
- }
- }
- else
- {
- cout << "Failed. outPutStructArray = NULL" << endl;
- }
-
- //testing echo void
- cout << "invoking echoVoid..." << endl;
-
- ws.setTransportProperty( "SOAPAction", "InteropBase#echoVoid");
- ws.echoVoid();
-
- cout << "successful" << endl;
-
- //testing echo base 64 binary
- const char * bstr = stringToAscii( "some string that is sent encoded to either base64Binary or hexBinary");
- xsd__base64Binary bb;
-
- cout << "invoking echoBase64..." << endl;
-
- bb.set( (unsigned char *) strdup( bstr), (xsd__int) strlen( bstr));
-
- ws.setTransportProperty( "SOAPAction", "InteropBase#echoBase64");
-
- xsd__base64Binary bbResult = ws.echoBase64( bb);
- xsd__int size = 0;
- const xsd__unsignedByte * data = bbResult.get( size);
-
- if( bb.getSize() == size)
- {
- cout << "successful" << endl;
- cout << "Returned String :" << endl << asciiToString( (char *) data) << endl;
- }
- else
- {
- cout << "Failed. The returned base 64 binary size (" << size << ") was not the same as the expected size (" << bb.getSize() << ")." << endl;
- }
-
- time_t timeToTest = 1100246323;
- struct tm * temp = gmtime( &timeToTest);
- struct tm time;
-
- memcpy( &time, temp, sizeof( struct tm));
-
- cout << "invoking echoDate..." << endl;
-
- ws.setTransportProperty( "SOAPAction", "InteropBase#echoDate");
-
- xsd__dateTime ed_temp = ws.echoDate( time);
-
- // A simple memcmp of ed_temp and time will not work because
- // it does not take into account timezone, so we need to
- // compare results of asctime()
- char ExpectedTime[1024];
- char ReturnedTime[1024];
-
- char * pExpectedTime = asctime( &time );
- int iETLength = (pExpectedTime != NULL) ? (int) strlen(pExpectedTime) : 0;
- if (iETLength > 0)
- strcpy(ExpectedTime, pExpectedTime);
-
- char * pReturnedTime = asctime( &ed_temp );
- int iRTLength = (pReturnedTime != NULL) ? (int) strlen(pReturnedTime) : 0;
- if( iRTLength > 0)
- strcpy(ReturnedTime, pReturnedTime);
-
- if( iETLength > 0 &&
- iRTLength > 0 &&
- strcmp(ExpectedTime, ReturnedTime) == 0)
- {
- cout << "successful" << endl;
- }
- else
- {
- if( iETLength == 0)
- strcpy(ExpectedTime,"NULL");
-
- if( iRTLength == 0)
- strcpy(ReturnedTime,"NULL");
-
- cout << "Failed. The expected time (" << ExpectedTime << ") was not the same as the returned time (" << ReturnedTime << ")." << endl;
- }
-
- //testing echo hex binary
- cout << "invoking echoHexBinary..." << endl;
-
- xsd__hexBinary hb;
-
- hb.set( (unsigned char *) strdup( bstr), (xsd__int) strlen( bstr));
-
- ws.setTransportProperty( "SOAPAction", "InteropBase#echoHexBinary");
-
- xsd__hexBinary hbResult = ws.echoHexBinary( hb);
-
- size = 0;
- data = hbResult.get( size);
-
- if( hb.getSize() == size)
- {
- cout << "successful" << endl;
- cout << "Returned String :" << endl << asciiToString( (char *) data) << endl;
- }
- else
- {
- cout << "Failed. The returned hex64Binary size (" << size << ") was not the same as the expected hex64Binary size (" << hb.getSize() << ")." << endl;
- }
-
- //testing echo decimal
- cout << "invoking echoDecimal..." << endl;
-
- ws.setTransportProperty( "SOAPAction", "InteropBase#echoDecimal");
-
- xsd__decimal decimalValue = 1234.567890;
- xsd__decimal decimalExpected = macro_ToTwoDecPlaces( decimalValue, xsd__decimal);
- xsd__decimal decimalReturn = ws.echoDecimal( decimalValue);
-
- if( decimalReturn > decimalExpected)
- {
- cout << "successful" << endl;
- }
- else
- {
- cout << "Failed. The returned value (" << decimalReturn << ") was not the same as the expected value (" << decimalExpected << ")." << endl;
- }
-
- //testing echo boolean
- cout << "invoking echoBoolean..." << endl;
-
- ws.setTransportProperty( "SOAPAction", "InteropBase#echoBoolean");
-
- xsd__boolean bExpected = true_;
- xsd__boolean bReturned = ws.echoBoolean( bExpected);
-
- if( bReturned == bExpected)
- {
- cout << "successful" << endl;
- }
- else
- {
- cout << "Failed. The returned value (" << macro_BoolToString( bReturned) << ") was not the same as the expected value (" << macro_BoolToString( bExpected) << ")." << endl;
- }
-
- bSuccess = true;
- }
- catch( AxisException& e)
- {
- bool bSilent = false;
-
- if( e.getExceptionCode() == CLIENT_TRANSPORT_OPEN_CONNECTION_FAILED)
- {
- if( iRetryIterationCount > 1)
- {
- bSilent = true;
- }
- }
- else
- {
- iRetryIterationCount = 0;
- }
+ for( count = 0; count < ARRAYSIZE; count++)
+ {
+ iToSend[count] = new xsd__int(count);
+ }
+
+ arrint.set( iToSend, ARRAYSIZE);
+
+ ws.setTransportProperty( "SOAPAction" , "InteropBase#echoIntegerArray");
+
+ cout << "invoking echoIntegerArray..." << endl;
+
+ outputSize = 0;
+
+ xsd__int_Array * outPutIntArray = ws.echoIntegerArray( &arrint);
+
+ if( outPutIntArray != NULL &&
+ outPutIntArray->get( outputSize) != NULL &&
+ outputSize == ARRAYSIZE)
+ {
+ cout << "successful" << endl;
+ }
+ else
+ {
+ cout << "Failed. outputsize=" << outputSize << endl;
+ }
+
+ // testing echoFloat
+ cout << "invoking echoFloat..." << endl;
+
+ float fvalue = (float) 1.4214;
+
+ ws.setTransportProperty( "SOAPAction", "InteropBase#echoFloat");
+
+ xsd__float retFloat = ws.echoFloat( fvalue);
+ xsd__float expFloat = macro_ToTwoDecPlaces( fvalue, float);
+
+ if( retFloat > expFloat)
+ {
+ cout << "successful" << endl;
+ }
+ else
+ {
+ cout << "Failed. The returned float (" << retFloat << ") was not the same as the expected float (" << expFloat << ")." << endl;
+ }
+
+ // testing echoFloatArray
+ xsd__float_Array arrfloat;
+ xsd__float ** fToSend = new xsd__float*[ARRAYSIZE];
+
+ for( count = 0; count < ARRAYSIZE; count++)
+ {
+ fToSend[count] = new xsd__float( (xsd__float) 1.1111 * (xsd__float) count);
+ }
+
+ arrfloat.set( fToSend, ARRAYSIZE);
+
+ ws.setTransportProperty( "SOAPAction", "InteropBase#echoFloatArray");
+
+ cout << "invoking echoFloatArray..." << endl;
+
+ outputSize = 0;
+
+ xsd__float_Array * outPutFloatArray = ws.echoFloatArray( &arrfloat);
+
+ if( outPutFloatArray != NULL &&
+ outPutFloatArray->get( outputSize) != NULL &&
+ outputSize == ARRAYSIZE)
+ {
+ cout << "successful" << endl;
+ }
+ else
+ {
+ cout << "Failed. outputsize=" << outputSize << endl;
+ }
+
+ // testing echo Struct
+ SOAPStruct stct;
+
+ stct.varFloat = new float;
+ stct.varInt = new int;
+
+ *(stct.varFloat) = (xsd__float) 12345.7346345;
+ *(stct.varInt) = 5000;
+
+ stct.varString = strdup( "This is string in SOAPStruct");
+
+ cout << "invoking echoStruct..." << endl;
+
+ ws.setTransportProperty( "SOAPAction", "InteropBase#echoStruct");
+
+ if( ws.echoStruct( &stct) != NULL)
+ {
+ cout << "successful" << endl;
+ }
+ else
+ {
+ cout << "Failed. The deserialised structure was null." << endl;
+ }
+
+ //testing echo Array of Struct
+ SOAPStruct_Array arrstct;
+ SOAPStruct ** m_Array4 = new SOAPStruct *[ARRAYSIZE];
+ SOAPStruct ssToSend[ARRAYSIZE];
+ xsd__float myFloat;
+
+ for( count = 0; count < ARRAYSIZE; count++)
+ {
+ myFloat = (xsd__float) (1.1111 * count);
+
+ ssToSend[count].setvarFloat( &myFloat);
+ ssToSend[count].setvarInt( &count);
+
+ sprintf( buffer1, "varString of %dth element of SOAPStruct array", count);
+
+ ssToSend[count].setvarString( buffer1);
+
+ m_Array4[count] = &ssToSend[count];
+ }
+
+ arrstct.set( m_Array4, ARRAYSIZE);
+
+ //testing echo Struct Array
+ ws.setTransportProperty( "SOAPAction", "InteropBase#echoStructArray");
+
+ cout << "invoking echoStructArray..." << endl;
+
+ SOAPStruct_Array * outPutStructArray = ws.echoStructArray( &arrstct);
+
+ if( outPutStructArray != NULL)
+ {
+ outputSize = 0;
+
+ SOAPStruct ** ppSOAPStruct = outPutStructArray->get( outputSize);
+
+ if( ppSOAPStruct != NULL && outputSize == ARRAYSIZE)
+ {
+ cout << "successful" << endl;
+ }
+ else
+ {
+ cout << "Failed. outputsize = " << outputSize << endl;
+
+ for( int iIndex = 0; iIndex < outputSize; iIndex++)
+ {
+ cout << "Failed(" << iIndex << ") varString = \"" << ppSOAPStruct[iIndex]->getvarString() << "\", varInt = " << *ppSOAPStruct[iIndex]->getvarInt() << ", varFloat = " << *ppSOAPStruct[iIndex]->getvarFloat() << endl;
+ }
+ }
+ }
+ else
+ {
+ cout << "Failed. outPutStructArray = NULL" << endl;
+ }
+
+ //testing echo void
+ cout << "invoking echoVoid..." << endl;
+
+ ws.setTransportProperty( "SOAPAction", "InteropBase#echoVoid");
+ ws.echoVoid();
+
+ cout << "successful" << endl;
+
+ //testing echo base 64 binary
+ const char * bstr = stringToAscii( "some string that is sent encoded to either base64Binary or hexBinary");
+ xsd__base64Binary bb;
+
+ cout << "invoking echoBase64..." << endl;
+
+ bb.set( (unsigned char *) strdup( bstr), (xsd__int) strlen( bstr));
+
+ ws.setTransportProperty( "SOAPAction", "InteropBase#echoBase64");
+
+ xsd__base64Binary bbResult = ws.echoBase64( bb);
+ xsd__int size = 0;
+ const xsd__unsignedByte * data = bbResult.get( size);
+
+ if( bb.getSize() == size)
+ {
+ cout << "successful" << endl;
+ cout << "Returned String :" << endl << asciiToString( (char *) data) << endl;
+ }
+ else
+ {
+ cout << "Failed. The returned base 64 binary size (" << size << ") was not the same as the expected size (" << bb.getSize() << ")." << endl;
+ }
+
+ time_t timeToTest = 1100246323;
+ struct tm * temp = gmtime( &timeToTest);
+ struct tm time;
+
+ memcpy( &time, temp, sizeof( struct tm));
+
+ cout << "invoking echoDate..." << endl;
+
+ ws.setTransportProperty( "SOAPAction", "InteropBase#echoDate");
+
+ xsd__dateTime ed_temp = ws.echoDate( time);
+
+ // A simple memcmp of ed_temp and time will not work because
+ // it does not take into account timezone, so we need to
+ // compare results of asctime()
+ char ExpectedTime[1024];
+ char ReturnedTime[1024];
+
+ char * pExpectedTime = asctime( &time );
+ int iETLength = (pExpectedTime != NULL) ? (int) strlen(pExpectedTime) : 0;
+ if (iETLength > 0)
+ strcpy(ExpectedTime, pExpectedTime);
+
+ char * pReturnedTime = asctime( &ed_temp );
+ int iRTLength = (pReturnedTime != NULL) ? (int) strlen(pReturnedTime) : 0;
+ if( iRTLength > 0)
+ strcpy(ReturnedTime, pReturnedTime);
+
+ if( iETLength > 0 &&
+ iRTLength > 0 &&
+ strcmp(ExpectedTime, ReturnedTime) == 0)
+ {
+ cout << "successful" << endl;
+ }
+ else
+ {
+ if( iETLength == 0)
+ strcpy(ExpectedTime,"NULL");
+
+ if( iRTLength == 0)
+ strcpy(ReturnedTime,"NULL");
+
+ cout << "Failed. The expected time (" << ExpectedTime << ") was not the same as the returned time (" << ReturnedTime << ")." << endl;
+ }
+
+ //testing echo hex binary
+ cout << "invoking echoHexBinary..." << endl;
+
+ xsd__hexBinary hb;
+
+ hb.set( (unsigned char *) strdup( bstr), (xsd__int) strlen( bstr));
+
+ ws.setTransportProperty( "SOAPAction", "InteropBase#echoHexBinary");
+
+ xsd__hexBinary hbResult = ws.echoHexBinary( hb);
+
+ size = 0;
+ data = hbResult.get( size);
+
+ if( hb.getSize() == size)
+ {
+ cout << "successful" << endl;
+ cout << "Returned String :" << endl << asciiToString( (char *) data) << endl;
+ }
+ else
+ {
+ cout << "Failed. The returned hex64Binary size (" << size << ") was not the same as the expected hex64Binary size (" << hb.getSize() << ")." << endl;
+ }
+
+ //testing echo decimal
+ cout << "invoking echoDecimal..." << endl;
+
+ ws.setTransportProperty( "SOAPAction", "InteropBase#echoDecimal");
+
+ xsd__decimal decimalValue = 1234.567890;
+ xsd__decimal decimalExpected = macro_ToTwoDecPlaces( decimalValue, xsd__decimal);
+ xsd__decimal decimalReturn = ws.echoDecimal( decimalValue);
+
+ if( decimalReturn > decimalExpected)
+ {
+ cout << "successful" << endl;
+ }
+ else
+ {
+ cout << "Failed. The returned value (" << decimalReturn << ") was not the same as the expected value (" << decimalExpected << ")." << endl;
+ }
+
+ //testing echo boolean
+ cout << "invoking echoBoolean..." << endl;
+
+ ws.setTransportProperty( "SOAPAction", "InteropBase#echoBoolean");
+
+ xsd__boolean bExpected = true_;
+ xsd__boolean bReturned = ws.echoBoolean( bExpected);
+
+ if( bReturned == bExpected)
+ {
+ cout << "successful" << endl;
+ }
+ else
+ {
+ cout << "Failed. The returned value (" << macro_BoolToString( bReturned) << ") was not the same as the expected value (" << macro_BoolToString( bExpected) << ")." << endl;
+ }
+
+ bSuccess = true;
+ }
+ catch( AxisException& e)
+ {
+ bool bSilent = false;
+
+ if( e.getExceptionCode() == CLIENT_TRANSPORT_OPEN_CONNECTION_FAILED)
+ {
+ if( iRetryIterationCount > 1)
+ {
+ bSilent = true;
+ }
+ }
+ else
+ {
+ iRetryIterationCount = 0;
+ }
if( !bSilent)
- {
- cout << "Exception: " << e.what() << " has occurred." << endl;
- }
- }
- catch( exception& e)
- {
- cout << "Exception: " << e.what() << " has occurred." << endl;
- }
- catch( ...)
- {
- cout << "An unknown exception has occurred." << endl;
- }
+ {
+ cout << "Exception: " << e.what() << " has occurred." << endl;
+ }
+ }
+ catch( exception& e)
+ {
+ cout << "Exception: " << e.what() << " has occurred." << endl;
+ }
+ catch( ...)
+ {
+ cout << "An unknown exception has occurred." << endl;
+ }
- iRetryIterationCount--;
+ iRetryIterationCount--;
- } while( iRetryIterationCount > 0 && !bSuccess);
+ } while( iRetryIterationCount > 0 && !bSuccess);
- return 0;
+ return 0;
}
Modified: webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/InteropTestRound1DocClient.cpp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/InteropTestRound1DocClient.cpp?rev=397747&r1=397746&r2=397747&view=diff
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/InteropTestRound1DocClient.cpp (original)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/InteropTestRound1DocClient.cpp Thu Apr 27 20:03:51 2006
@@ -25,244 +25,244 @@
int main(int argc, char* argv[])
{
- int x;
- char buffer1[100];
- char buffer2[100];
- char endpoint[256];
- const char* server="localhost";
- const char* port="8080";
- sprintf(endpoint, "http://%s:%s/axis/InteropBaseDoc", server, port);
- bool bSuccess = false;
- int iRetryIterationCount = 3;
-
- do
- {
- try
- {
- InteropTestPortTypeDoc ws(endpoint, APTHTTP1_1);
-
-
- ws.setTransportTimeout(5);
-
- printf("invoking echoString...\n");
- //testing echoString
- string bigstring;
- for (int ii=0;ii<2;ii++)
- {
- bigstring += "hello world ";
- }
-
- ws.setTransportProperty("SOAPAction" , "InteropBaseDoc#echoString");
- strcpy(buffer1, bigstring.c_str());
- printf(ws.echoString(buffer1));
- if (0 == strcmp(ws.echoString("hello world"), "hello world"))
- printf("successful\n");
- else
- printf("failed\n");
- // testing echoStringArray
- xsd__string_Array arrstr;
- xsd__string* sToSend = new xsd__string[ARRAYSIZE];
- sprintf(buffer1, "%dth element of string array", 0);
- sprintf(buffer2, "%dth element of string array", 1);
- sToSend[0]= buffer1;
- sToSend[1]= buffer2;
-
- arrstr.set(sToSend, ARRAYSIZE);
-
- //arrstr.m_Array[1] = buffer2;
- printf("invoking echoStringArray...\n");
- ws.setTransportProperty("SOAPAction" , "InteropBase#echoStringArray");
- int outputSize = 0;
- xsd__string_Array * outPutStrArray = ws.echoStringArray(&arrstr);
- if (outPutStrArray->get(outputSize) != NULL)
- printf("successful\n");
- else
- printf("failed\n");
-
- // testing echoInteger
- printf("invoking echoInteger...\n");
- ws.setTransportProperty("SOAPAction" , "InteropBaseDoc#echoInteger");
- if (ws.echoInteger(56) == 56)
- printf("successful\n");
- else
- printf("failed\n");
- // testing echoIntegerArray
- xsd__int_Array arrint;
- xsd__int ** iToSend = new xsd__int*[ARRAYSIZE];
+ int x;
+ char buffer1[100];
+ char buffer2[100];
+ char endpoint[256];
+ const char* server="localhost";
+ const char* port="8080";
+ sprintf(endpoint, "http://%s:%s/axis/InteropBaseDoc", server, port);
+ bool bSuccess = false;
+ int iRetryIterationCount = 3;
+
+ do
+ {
+ try
+ {
+ InteropTestPortTypeDoc ws(endpoint, APTHTTP1_1);
+
+
+ ws.setTransportTimeout(5);
+
+ printf("invoking echoString...\n");
+ //testing echoString
+ string bigstring;
+ for (int ii=0;ii<2;ii++)
+ {
+ bigstring += "hello world ";
+ }
+
+ ws.setTransportProperty("SOAPAction" , "InteropBaseDoc#echoString");
+ strcpy(buffer1, bigstring.c_str());
+ printf(ws.echoString(buffer1));
+ if (0 == strcmp(ws.echoString("hello world"), "hello world"))
+ printf("successful\n");
+ else
+ printf("failed\n");
+ // testing echoStringArray
+ xsd__string_Array arrstr;
+ xsd__string* sToSend = new xsd__string[ARRAYSIZE];
+ sprintf(buffer1, "%dth element of string array", 0);
+ sprintf(buffer2, "%dth element of string array", 1);
+ sToSend[0]= buffer1;
+ sToSend[1]= buffer2;
+
+ arrstr.set(sToSend, ARRAYSIZE);
+
+ //arrstr.m_Array[1] = buffer2;
+ printf("invoking echoStringArray...\n");
+ ws.setTransportProperty("SOAPAction" , "InteropBase#echoStringArray");
+ int outputSize = 0;
+ xsd__string_Array * outPutStrArray = ws.echoStringArray(&arrstr);
+ if (outPutStrArray->get(outputSize) != NULL)
+ printf("successful\n");
+ else
+ printf("failed\n");
+
+ // testing echoInteger
+ printf("invoking echoInteger...\n");
+ ws.setTransportProperty("SOAPAction" , "InteropBaseDoc#echoInteger");
+ if (ws.echoInteger(56) == 56)
+ printf("successful\n");
+ else
+ printf("failed\n");
+ // testing echoIntegerArray
+ xsd__int_Array arrint;
+ xsd__int ** iToSend = new xsd__int*[ARRAYSIZE];
- for (x=0;x<ARRAYSIZE;x++)
- {
- iToSend[x] = new xsd__int(x);
- }
- arrint.set(iToSend,ARRAYSIZE);
-
- printf("invoking echoIntegerArray...\n");
- outputSize = 0;
- ws.setTransportProperty("SOAPAction" , "InteropBase#echoIntegerArray");
- xsd__int_Array * outPutIntArray = ws.echoIntegerArray(&arrint);
- if (outPutIntArray->get(outputSize)!= NULL)
- printf("successful\n");
- else
- printf("failed\n");
-
- // testing echoFloat
- printf("invoking echoFloat...\n");
- float fvalue = 1.4214;
- ws.setTransportProperty("SOAPAction" , "InteropBaseDoc#echoFloat");
- if (ws.echoFloat(fvalue) > 1.42)
- printf("successful\n");
- else
- printf("failed\n");
- // testing echoFloat
- xsd__float_Array arrfloat;
- xsd__float** fToSend = new xsd__float*[ARRAYSIZE];
- for (x=0;x<ARRAYSIZE;x++)
- {
- fToSend[x] = new xsd__float(1.1111*x);
- }
- arrfloat.set(fToSend, ARRAYSIZE);\
-
- printf("invoking echoFloatArray...\n");
- ws.setTransportProperty("SOAPAction" , "InteropBaseDoc#echoFloatArray");
- outputSize = 0;
-
- if (ws.echoFloatArray(&arrfloat)->get(outputSize)!= NULL)
- printf("successful\n");
- else
- printf("failed\n");
- // testing echo Struct
- SOAPStruct stct;
- stct.varFloat = 12345.7346345;
- stct.varInt = 5000;
- stct.varString = strdup("This is string in SOAPStruct");
- printf("invoking echoStruct...\n");
- ws.setTransportProperty("SOAPAction" , "InteropBaseDoc#echoStruct");
- if (ws.echoStruct(&stct) != NULL)
- printf("successful\n");
- else
- printf("failed\n");
- //testing echo Array of Struct
- /*SOAPStruct_Array arrstct;
- arrstct.m_Array = new SOAPStruct*[ARRAYSIZE];
- arrstct.m_Size = ARRAYSIZE;
- for (x=0;x<ARRAYSIZE;x++)
- {
- arrstct.m_Array[x]->varFloat = 1.1111*x;
- arrstct.m_Array[x]->varInt = x;
- sprintf(buffer1, "varString of %dth element of SOAPStruct array", x);
- arrstct.m_Array[x]->varString = buffer1;
- }
- //testing echo Struct Array
- //printf("invoking echoStructArray...\n");
- //ws.setTransportProperty("SOAPAction" , "InteropBaseDoc#echoStructArray");
- //if (ws.echoStructArray(arrstct).m_Array != NULL)
- // printf("successful\n");
- //else
- // printf("failed\n");*/
- //testing echo void
- printf("invoking echoVoid...\n");
- ws.setTransportProperty("SOAPAction" , "InteropBaseDoc#echoVoid");
- ws.echoVoid();
- printf("successful\n");
- //testing echo base 64 binary
+ for (x=0;x<ARRAYSIZE;x++)
+ {
+ iToSend[x] = new xsd__int(x);
+ }
+ arrint.set(iToSend,ARRAYSIZE);
+
+ printf("invoking echoIntegerArray...\n");
+ outputSize = 0;
+ ws.setTransportProperty("SOAPAction" , "InteropBase#echoIntegerArray");
+ xsd__int_Array * outPutIntArray = ws.echoIntegerArray(&arrint);
+ if (outPutIntArray->get(outputSize)!= NULL)
+ printf("successful\n");
+ else
+ printf("failed\n");
+
+ // testing echoFloat
+ printf("invoking echoFloat...\n");
+ float fvalue = 1.4214;
+ ws.setTransportProperty("SOAPAction" , "InteropBaseDoc#echoFloat");
+ if (ws.echoFloat(fvalue) > 1.42)
+ printf("successful\n");
+ else
+ printf("failed\n");
+ // testing echoFloat
+ xsd__float_Array arrfloat;
+ xsd__float** fToSend = new xsd__float*[ARRAYSIZE];
+ for (x=0;x<ARRAYSIZE;x++)
+ {
+ fToSend[x] = new xsd__float(1.1111*x);
+ }
+ arrfloat.set(fToSend, ARRAYSIZE);\
+
+ printf("invoking echoFloatArray...\n");
+ ws.setTransportProperty("SOAPAction" , "InteropBaseDoc#echoFloatArray");
+ outputSize = 0;
+
+ if (ws.echoFloatArray(&arrfloat)->get(outputSize)!= NULL)
+ printf("successful\n");
+ else
+ printf("failed\n");
+ // testing echo Struct
+ SOAPStruct stct;
+ stct.varFloat = 12345.7346345;
+ stct.varInt = 5000;
+ stct.varString = strdup("This is string in SOAPStruct");
+ printf("invoking echoStruct...\n");
+ ws.setTransportProperty("SOAPAction" , "InteropBaseDoc#echoStruct");
+ if (ws.echoStruct(&stct) != NULL)
+ printf("successful\n");
+ else
+ printf("failed\n");
+ //testing echo Array of Struct
+ /*SOAPStruct_Array arrstct;
+ arrstct.m_Array = new SOAPStruct*[ARRAYSIZE];
+ arrstct.m_Size = ARRAYSIZE;
+ for (x=0;x<ARRAYSIZE;x++)
+ {
+ arrstct.m_Array[x]->varFloat = 1.1111*x;
+ arrstct.m_Array[x]->varInt = x;
+ sprintf(buffer1, "varString of %dth element of SOAPStruct array", x);
+ arrstct.m_Array[x]->varString = buffer1;
+ }
+ //testing echo Struct Array
+ //printf("invoking echoStructArray...\n");
+ //ws.setTransportProperty("SOAPAction" , "InteropBaseDoc#echoStructArray");
+ //if (ws.echoStructArray(arrstct).m_Array != NULL)
+ // printf("successful\n");
+ //else
+ // printf("failed\n");*/
+ //testing echo void
+ printf("invoking echoVoid...\n");
+ ws.setTransportProperty("SOAPAction" , "InteropBaseDoc#echoVoid");
+ ws.echoVoid();
+ printf("successful\n");
+ //testing echo base 64 binary
- const char* bstr = stringToAscii("some string that is sent encoded to either base64Binary or hexBinary");
+ const char* bstr = stringToAscii("some string that is sent encoded to either base64Binary or hexBinary");
- printf("invoking echoBase64...\n");
- xsd__base64Binary bb;
+ printf("invoking echoBase64...\n");
+ xsd__base64Binary bb;
bb.set((unsigned char*)strdup(bstr), strlen(bstr));
- ws.setTransportProperty("SOAPAction" , "InteropBaseDoc#echoBase64");
+ ws.setTransportProperty("SOAPAction" , "InteropBaseDoc#echoBase64");
xsd__base64Binary bbResult = ws.echoBase64(bb);
int size = 0;
xsd__unsignedByte * data = bbResult.get(size);
- if (bb.getSize() == size)
- {
- printf("successful\n");
- printf("Returned String :\n%s\n", asciiToString((char *)data));
- }
- else
- printf("failed\n");
+ if (bb.getSize() == size)
+ {
+ printf("successful\n");
+ printf("Returned String :\n%s\n", asciiToString((char *)data));
+ }
+ else
+ printf("failed\n");
time_t timeToTest = 1100246323;
struct tm *temp = gmtime(&timeToTest);
struct tm time;
memcpy(&time, temp, sizeof(struct tm));
- printf("invoking echoDate...\n");
- ws.setTransportProperty("SOAPAction" , "InteropBase#echoDate");
+ printf("invoking echoDate...\n");
+ ws.setTransportProperty("SOAPAction" , "InteropBase#echoDate");
xsd__dateTime ed_temp = ws.echoDate(time);
- if (memcmp(&ed_temp, &time, sizeof(tm)) == 0)
+ if (memcmp(&ed_temp, &time, sizeof(tm)) == 0)
- if (memcmp(&ed_temp, &time, sizeof(tm)) == 0)
- printf("successful\n");
- else
- printf("failed\n");
- //testing echo hex binary
+ if (memcmp(&ed_temp, &time, sizeof(tm)) == 0)
+ printf("successful\n");
+ else
+ printf("failed\n");
+ //testing echo hex binary
- printf("invoking echoHexBinary...\n");
- xsd__hexBinary hb;
+ printf("invoking echoHexBinary...\n");
+ xsd__hexBinary hb;
hb.set((unsigned char*)strdup(bstr), strlen(bstr));
- ws.setTransportProperty("SOAPAction" , "InteropBaseDoc#echoHexBinary");
+ ws.setTransportProperty("SOAPAction" , "InteropBaseDoc#echoHexBinary");
xsd__hexBinary hbResult = ws.echoHexBinary(hb);
size = 0;
data = hbResult.get(size);
- if (hb.getSize() == size)
- {
- printf("successful\n");
- printf("Returned String :\n%s\n", asciiToString((char *)data));
- }
- else
- printf("failed\n");
- //testing echo decimal
- printf("invoking echoDecimal...\n");
- xsd__decimal dd = 1234.567890;
- ws.setTransportProperty("SOAPAction" , "InteropBaseDoc#echoDecimal");
- if (*(ws.echoDecimal(&dd)) > 1234.56)
- printf("successful\n");
- else
- printf("failed\n");
- //testing echo boolean
- printf("invoking echoBoolean...\n");
- ws.setTransportProperty("SOAPAction" , "InteropBaseDoc#echoBoolean");
- if (ws.echoBoolean(true_) == true_)
- printf("successful\n");
- else
- printf("failed\n");
-
- bSuccess = true;
- }
- catch(AxisException& e)
- {
- bool bSilent = false;
-
- if( e.getExceptionCode() == CLIENT_TRANSPORT_OPEN_CONNECTION_FAILED)
- {
- if( iRetryIterationCount > 0)
- {
- bSilent = true;
- }
- }
- else
- {
- iRetryIterationCount = 0;
- }
+ if (hb.getSize() == size)
+ {
+ printf("successful\n");
+ printf("Returned String :\n%s\n", asciiToString((char *)data));
+ }
+ else
+ printf("failed\n");
+ //testing echo decimal
+ printf("invoking echoDecimal...\n");
+ xsd__decimal dd = 1234.567890;
+ ws.setTransportProperty("SOAPAction" , "InteropBaseDoc#echoDecimal");
+ if (*(ws.echoDecimal(&dd)) > 1234.56)
+ printf("successful\n");
+ else
+ printf("failed\n");
+ //testing echo boolean
+ printf("invoking echoBoolean...\n");
+ ws.setTransportProperty("SOAPAction" , "InteropBaseDoc#echoBoolean");
+ if (ws.echoBoolean(true_) == true_)
+ printf("successful\n");
+ else
+ printf("failed\n");
+
+ bSuccess = true;
+ }
+ 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(...)
- {
- printf("Unknown exception has occured\n");
- }
- iRetryIterationCount--;
- } while( iRetryIterationCount > 0 && !bSuccess);
- //getchar();
- return 0;
+ {
+ printf("%s\n", e.what());
+ }
+ }
+ catch(exception& e)
+ {
+ printf("%s\n", e.what());
+ }
+ catch(...)
+ {
+ printf("Unknown exception has occured\n");
+ }
+ iRetryIterationCount--;
+ } while( iRetryIterationCount > 0 && !bSuccess);
+ //getchar();
+ return 0;
}
Modified: webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/LargeReturningStringClient.cpp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/LargeReturningStringClient.cpp?rev=397747&r1=397746&r2=397747&view=diff
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/LargeReturningStringClient.cpp (original)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/LargeReturningStringClient.cpp Thu Apr 27 20:03: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 "LargeReturningString.hpp"
#include <stdlib.h> // For malloc(), calloc(), strdup() and free()
Modified: webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/LargeReturningStringSSLClient.cpp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/LargeReturningStringSSLClient.cpp?rev=397747&r1=397746&r2=397747&view=diff
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/LargeReturningStringSSLClient.cpp (original)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/LargeReturningStringSSLClient.cpp Thu Apr 27 20:03:51 2006
@@ -31,137 +31,137 @@
int main( int argc, char * argv[])
{
- LargeReturningString * ws;
- char * endpoint = WSDL_DEFAULT_ENDPOINT;
- bool endpoint_set = false;
- int returnValue = 1; // Assume Failure
- const char* sslkeyhome = 0;
- char keylocation[255];
-
-
- endpoint_set = parse_args_for_endpoint( &argc, argv, &endpoint);
-
- bool bSuccess = false;
- int iRetryIterationCount = 3;
-
- do
- {
- try
- {
- if( endpoint_set)
- {
- ws = new LargeReturningString( endpoint, APTHTTP1_1);
- free( endpoint);
- endpoint_set = false;
- }
- else
- {
- ws = new LargeReturningString();
- }
+ LargeReturningString * ws;
+ char * endpoint = WSDL_DEFAULT_ENDPOINT;
+ bool endpoint_set = false;
+ int returnValue = 1; // Assume Failure
+ const char* sslkeyhome = 0;
+ char keylocation[255];
+
+
+ endpoint_set = parse_args_for_endpoint( &argc, argv, &endpoint);
+
+ bool bSuccess = false;
+ int iRetryIterationCount = 3;
+
+ do
+ {
+ try
+ {
+ if( endpoint_set)
+ {
+ ws = new LargeReturningString( endpoint, APTHTTP1_1);
+ free( endpoint);
+ endpoint_set = false;
+ }
+ else
+ {
+ ws = new LargeReturningString();
+ }
- int input = 2 * 1024 * 1024;
- xsd__string result = "";
+ int input = 2 * 1024 * 1024;
+ xsd__string result = "";
// Extend transport timeout to 60 seconds (default is 10).
- sslkeyhome=getenv("SSL_KEYS_HOME");
+ sslkeyhome=getenv("SSL_KEYS_HOME");
- if (!sslkeyhome)
- {
- cout << "SSL_KEYS_HOME not set" << endl;
- return 1;
- }
-
- sprintf(keylocation,"%s/%s",sslkeyhome,"myKeyRing.kdb");
- ws->SetSecure(keylocation, "axis4all", "AXIS", "NONE", "05", "NONE", false);
-
- ws->setTransportTimeout( 60);
-
- result = ws->getLargeString(input);
-
- cout << "Result" << endl;
-
- if ( result == NULL)
- {
- cout << "NULL" << endl;
- }
-
- if( strlen( result) == input)
- {
- cout << (int) strlen( result) << endl;
- }
- else
- {
- int iError = 0;
-
- for( int x = 0; x < input; x++)
- {
- if( result[x] != 'a' + (x + iError) % 26)
- {
- cout << "Error. result[" << x << "] should have been " << (char) ('a' + x % 26) << " but was " << result[x] << endl;
-
- iError++;
- }
- }
-
- cout << "There where " << iError << " errors." << endl;
- cout << "Requested " << input << " bytes. Received " << (int) strlen( result) << " bytes." << endl;
-
- returnValue = 0; // Success
- }
-
- bSuccess = true;
- }
- catch( AxisException &e)
- {
- bool bSilent = false;
-
- if( e.getExceptionCode() == CLIENT_TRANSPORT_OPEN_CONNECTION_FAILED)
- {
- if( iRetryIterationCount > 1)
- {
- bSilent = true;
- }
- }
- else
- {
- iRetryIterationCount = 0;
- }
+ if (!sslkeyhome)
+ {
+ cout << "SSL_KEYS_HOME not set" << endl;
+ return 1;
+ }
+
+ sprintf(keylocation,"%s/%s",sslkeyhome,"myKeyRing.kdb");
+ ws->SetSecure(keylocation, "axis4all", "AXIS", "NONE", "05", "NONE", false);
+
+ ws->setTransportTimeout( 60);
+
+ result = ws->getLargeString(input);
+
+ cout << "Result" << endl;
+
+ if ( result == NULL)
+ {
+ cout << "NULL" << endl;
+ }
+
+ if( strlen( result) == input)
+ {
+ cout << (int) strlen( result) << endl;
+ }
+ else
+ {
+ int iError = 0;
+
+ for( int x = 0; x < input; x++)
+ {
+ if( result[x] != 'a' + (x + iError) % 26)
+ {
+ cout << "Error. result[" << x << "] should have been " << (char) ('a' + x % 26) << " but was " << result[x] << endl;
+
+ iError++;
+ }
+ }
+
+ cout << "There where " << iError << " errors." << endl;
+ cout << "Requested " << input << " bytes. Received " << (int) strlen( result) << " bytes." << endl;
+
+ returnValue = 0; // Success
+ }
+
+ bSuccess = true;
+ }
+ catch( AxisException &e)
+ {
+ bool bSilent = false;
+
+ if( e.getExceptionCode() == CLIENT_TRANSPORT_OPEN_CONNECTION_FAILED)
+ {
+ if( iRetryIterationCount > 1)
+ {
+ bSilent = true;
+ }
+ }
+ else
+ {
+ iRetryIterationCount = 0;
+ }
if( !bSilent)
- {
- cout << e.what() << endl;
- }
- }
- catch( ...)
- {
- cout << "Unknown Exception occured." << endl;
- }
-
- try
- {
- delete ws;
- }
- catch( exception& exception)
- {
- cout << "Exception on clean up of ws: " << exception.what() << endl;
- }
- catch( ...)
- {
- cout << "Unknown exception on clean up of ws: " << endl;
- }
+ {
+ cout << e.what() << endl;
+ }
+ }
+ catch( ...)
+ {
+ cout << "Unknown Exception occured." << endl;
+ }
+
+ try
+ {
+ delete ws;
+ }
+ catch( exception& exception)
+ {
+ cout << "Exception on clean up of ws: " << exception.what() << endl;
+ }
+ catch( ...)
+ {
+ cout << "Unknown exception on clean up of ws: " << endl;
+ }
- iRetryIterationCount--;
- } while( iRetryIterationCount > 0 && !bSuccess);
+ iRetryIterationCount--;
+ } while( iRetryIterationCount > 0 && !bSuccess);
if( endpoint_set)
- {
- free( endpoint);
- }
+ {
+ free( endpoint);
+ }
- cout << "---------------------- TEST COMPLETE -----------------------------" << endl;
+ cout << "---------------------- TEST COMPLETE -----------------------------" << endl;
- return returnValue;
+ return returnValue;
}
/* Spin through args list and check for -e -p and -s options.