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/17 07:07:54 UTC
svn commit: r407158 -
/webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/
Author: nadiramra
Date: Tue May 16 22:07:53 2006
New Revision: 407158
URL: http://svn.apache.org/viewcvs?rev=407158&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/RpcHttpHeaderTest1Client.cpp
webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/RpcHttpHeaderTest2Client.cpp
webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/RpcHttpHeaderTest3Client.cpp
webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/RpcHttpHeaderTest4Client.cpp
webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/RpcHttpHeaderTest5Client.cpp
webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/RpcHttpHeaderTest7Client.cpp
webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/RpcHttpHeaderTest8Client.cpp
Modified: webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/RpcHttpHeaderTest1Client.cpp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/RpcHttpHeaderTest1Client.cpp?rev=407158&r1=407157&r2=407158&view=diff
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/RpcHttpHeaderTest1Client.cpp (original)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/RpcHttpHeaderTest1Client.cpp Tue May 16 22:07:53 2006
@@ -24,6 +24,16 @@
* @author Roshan Weerasuriya (roshan@opensource.lk, roshanw@jkcsworld.com)
*/
+/* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! */
+/* 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 <string>
#include <iostream>
using namespace std;
@@ -48,9 +58,7 @@
// Set the endpoint from command line argument if set
if (argc > 1)
- {
strcpy(endpoint, argv[1]);
- }
/*Set for HTTP transport */
InteropTestPortType ws(endpoint, APTHTTP1_1);
@@ -68,13 +76,9 @@
try
{
if (0 == strcmp(ws.echoString("hello world"), "hello world"))
- {
cout << "successful" << endl;
- }
else
- {
cout << "failed" << endl;
- }
bSuccess = true;
}
@@ -85,19 +89,13 @@
if( e.getExceptionCode() == CLIENT_TRANSPORT_OPEN_CONNECTION_FAILED)
{
if( iRetryIterationCount > 0)
- {
bSilent = true;
- }
}
else
- {
iRetryIterationCount = 0;
- }
if( !bSilent)
- {
cout << "AxisException : " << e.what() << endl;
- }
}
catch(exception& e)
{
@@ -128,13 +126,9 @@
try
{
if (0 == strcmp(ws.echoString("hello world"), "hello world"))
- {
cout << "successful" << endl;
- }
else
- {
cout << "failed" << endl;
- }
bSuccess = true;
}
@@ -145,19 +139,13 @@
if( e.getExceptionCode() == CLIENT_TRANSPORT_OPEN_CONNECTION_FAILED)
{
if( iRetryIterationCount > 0)
- {
bSilent = true;
- }
}
else
- {
iRetryIterationCount = 0;
- }
if( !bSilent)
- {
cout << "AxisException : "<< e.what() << endl;
- }
}
catch(exception& e)
{
Modified: webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/RpcHttpHeaderTest2Client.cpp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/RpcHttpHeaderTest2Client.cpp?rev=407158&r1=407157&r2=407158&view=diff
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/RpcHttpHeaderTest2Client.cpp (original)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/RpcHttpHeaderTest2Client.cpp Tue May 16 22:07:53 2006
@@ -24,6 +24,16 @@
* @author Roshan Weerasuriya (roshan@opensource.lk, roshanw@jkcsworld.com)
*/
+/* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! */
+/* 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 <string>
#include <iostream>
using namespace std;
@@ -47,9 +57,7 @@
// Set the endpoint from command line argument if set
if (argc > 1)
- {
strcpy(endpoint, argv[1]);
- }
/*Set for HTTP transport */
InteropTestPortType ws(endpoint, APTHTTP1_1);
@@ -61,7 +69,7 @@
ws.setTransportProperty("Date", "Sat, 26 Jun 2004 13:32:19 GMT");
cout << "invoking echoString..." << endl;
- //testing echoString
+ //testing echoString
bool bSuccess = false;
int iRetryIterationCount = 3;
@@ -70,36 +78,26 @@
try
{
if (0 == strcmp(ws.echoString("hello world"), "hello world"))
- {
cout << "successful" << endl;
- }
else
- {
cout << "failed" << endl;
- }
bSuccess = true;
}
- catch(AxisException& e)
+ catch(AxisException& e)
{
bool bSilent = false;
if( e.getExceptionCode() == CLIENT_TRANSPORT_OPEN_CONNECTION_FAILED)
{
if( iRetryIterationCount > 0)
- {
bSilent = true;
- }
}
else
- {
iRetryIterationCount = 0;
- }
if( !bSilent)
- {
cout << "AxisException : " << e.what() << endl;
- }
}
catch(exception& e)
{
@@ -110,14 +108,14 @@
cout << "Unknown exception" << endl;
}
- iRetryIterationCount--;
+ iRetryIterationCount--;
} while( iRetryIterationCount > 0 && !bSuccess);
cout << "Test transport property accessors" << endl;
cout << "First transport key = ";
cout << ws.getFirstTransportPropertyKey(false) << endl;
cout << "First transport value = ";
- cout << ws.getCurrentTransportPropertyValue(false) << endl;
+ cout << ws.getCurrentTransportPropertyValue(false) << endl;
const char *key = NULL;
int count = 1;
while (key = ws.getNextTransportPropertyKey(false))
@@ -128,9 +126,7 @@
count++;
//test removal of last transport property
if (count == 4)
- {
ws.deleteCurrentTransportProperty(false);
- }
}
//test removing HTTP headers
@@ -146,13 +142,9 @@
try
{
if (0 == strcmp(ws.echoString("hello world"), "hello world"))
- {
cout << "successful" << endl;
- }
else
- {
cout << "failed" << endl;
- }
bSuccess = true;
}
@@ -163,19 +155,13 @@
if( e.getExceptionCode() == CLIENT_TRANSPORT_OPEN_CONNECTION_FAILED)
{
if( iRetryIterationCount > 0)
- {
bSilent = true;
- }
}
else
- {
iRetryIterationCount = 0;
- }
if( !bSilent)
- {
cout << "AxisException : " << e.what() << endl;
- }
}
catch(exception& e)
{
@@ -186,7 +172,7 @@
cout << "Unknown exception" << endl;
}
- iRetryIterationCount--;
+ iRetryIterationCount--;
} while( iRetryIterationCount > 0 && !bSuccess);
cout << "HTTP Header test end" << endl;
Modified: webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/RpcHttpHeaderTest3Client.cpp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/RpcHttpHeaderTest3Client.cpp?rev=407158&r1=407157&r2=407158&view=diff
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/RpcHttpHeaderTest3Client.cpp (original)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/RpcHttpHeaderTest3Client.cpp Tue May 16 22:07:53 2006
@@ -23,6 +23,14 @@
*
* @author Roshan Weerasuriya (roshan@opensource.lk, roshanw@jkcsworld.com)
*/
+/* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! */
+/* 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 <string>
#include <iostream>
@@ -47,9 +55,7 @@
// Set the endpoint from command line argument if set
if (argc > 1)
- {
strcpy(endpoint, argv[1]);
- }
/*Set for HTTP transport */
@@ -61,7 +67,7 @@
ws.setTransportProperty("Accept-Language", "lang3");
cout << "invoking echoString..." << endl;
- //testing echoString
+ //testing echoString
bool bSuccess = false;
int iRetryIterationCount = 3;
@@ -70,36 +76,26 @@
try
{
if (0 == strcmp(ws.echoString("hello world"), "hello world"))
- {
cout << "successful" << endl;
- }
else
- {
cout << "failed" << endl;
- }
bSuccess = true;
}
- catch(AxisException& e)
+ catch(AxisException& e)
{
bool bSilent = false;
if( e.getExceptionCode() == CLIENT_TRANSPORT_OPEN_CONNECTION_FAILED)
{
if( iRetryIterationCount > 0)
- {
bSilent = true;
- }
}
else
- {
iRetryIterationCount = 0;
- }
if( !bSilent)
- {
cout << "AxisException : " << e.what() << endl;
- }
}
catch(exception& e)
{
@@ -115,7 +111,7 @@
cout << "Test transport property accessors" << endl;
cout << "First transport key = " << ws.getFirstTransportPropertyKey(false) << endl;
cout << "First transport value = ";
- cout << ws.getCurrentTransportPropertyValue(false) <<endl;
+ cout << ws.getCurrentTransportPropertyValue(false) <<endl;
const char *key = NULL;
int count = 1;
while (key = ws.getNextTransportPropertyKey(false))
@@ -126,9 +122,7 @@
count++;
//test removal of last transport property
if (count == 3)
- {
ws.deleteCurrentTransportProperty(false);
- }
}
//test removing HTTP headers
@@ -143,13 +137,9 @@
try
{
if (0 == strcmp(ws.echoString("hello world"), "hello world"))
- {
cout << "successful" << endl;
- }
else
- {
cout << "failed" << endl;
- }
bSuccess = true;
}
@@ -160,19 +150,13 @@
if( e.getExceptionCode() == CLIENT_TRANSPORT_OPEN_CONNECTION_FAILED)
{
if( iRetryIterationCount > 0)
- {
bSilent = true;
- }
}
else
- {
iRetryIterationCount = 0;
- }
if( !bSilent)
- {
cout << "AxisException : " << e.what() << endl;
- }
}
catch (exception& e)
{
Modified: webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/RpcHttpHeaderTest4Client.cpp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/RpcHttpHeaderTest4Client.cpp?rev=407158&r1=407157&r2=407158&view=diff
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/RpcHttpHeaderTest4Client.cpp (original)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/RpcHttpHeaderTest4Client.cpp Tue May 16 22:07:53 2006
@@ -23,6 +23,14 @@
*
* @author Roshan Weerasuriya (roshan@opensource.lk, roshanw@jkcsworld.com)
*/
+/* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! */
+/* 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 <string>
#include <iostream>
@@ -47,9 +55,7 @@
// Set the endpoint from command line argument if set
if (argc > 1)
- {
strcpy(endpoint, argv[1]);
- }
/*Set for HTTP transport */
InteropTestPortType ws(endpoint, APTHTTP1_1);
@@ -61,7 +67,7 @@
ws.setTransportProperty("Accept-Language", "lang2");
cout << "invoking echoString..." << endl;
- //testing echoString
+ //testing echoString
bool bSuccess = false;
int iRetryIterationCount = 3;
@@ -70,36 +76,26 @@
try
{
if (0 == strcmp(ws.echoString("hello world"), "hello world"))
- {
cout << "successful" << endl;
- }
else
- {
cout << "failed" << endl;
- }
bSuccess = true;
}
- catch(AxisException& e)
+ catch(AxisException& e)
{
bool bSilent = false;
if( e.getExceptionCode() == CLIENT_TRANSPORT_OPEN_CONNECTION_FAILED)
{
if( iRetryIterationCount > 0)
- {
bSilent = true;
- }
}
else
- {
iRetryIterationCount = 0;
- }
if( !bSilent)
- {
cout << "AxisException : " << e.what() << endl;
- }
}
catch(exception& e)
{
@@ -110,14 +106,14 @@
cout << "Unknown exception" << endl;
}
- iRetryIterationCount--;
+ iRetryIterationCount--;
} while( iRetryIterationCount > 0 && !bSuccess);
cout << "Test transport property accessors" << endl;
cout << "First transport key = ";
cout << ws.getFirstTransportPropertyKey(false) << endl;
cout << "First transport value = ";
- cout << ws.getCurrentTransportPropertyValue(false) << endl;
+ cout << ws.getCurrentTransportPropertyValue(false) << endl;
const char *key = NULL;
int count = 1;
while (key = ws.getNextTransportPropertyKey(false))
@@ -128,9 +124,7 @@
count++;
//test removal of last transport property
if (count == 4)
- {
ws.deleteCurrentTransportProperty(false);
- }
}
//test removing HTTP headers
@@ -145,13 +139,9 @@
try
{
if (0 == strcmp(ws.echoString("hello world"), "hello world"))
- {
cout << "successful" << endl;
- }
else
- {
cout << "failed " << endl;
- }
bSuccess = true;
}
@@ -162,19 +152,13 @@
if( e.getExceptionCode() == CLIENT_TRANSPORT_OPEN_CONNECTION_FAILED)
{
if( iRetryIterationCount > 0)
- {
bSilent = true;
- }
}
else
- {
iRetryIterationCount = 0;
- }
if( !bSilent)
- {
cout << "AxisException : " << e.what() << endl;
- }
}
catch(exception& e)
{
@@ -184,7 +168,7 @@
{
cout << "Unknown exception" << endl;
}
- iRetryIterationCount--;
+ iRetryIterationCount--;
} while( iRetryIterationCount > 0 && !bSuccess);
cout << "HTTP Header test end" << endl;
Modified: webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/RpcHttpHeaderTest5Client.cpp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/RpcHttpHeaderTest5Client.cpp?rev=407158&r1=407157&r2=407158&view=diff
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/RpcHttpHeaderTest5Client.cpp (original)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/RpcHttpHeaderTest5Client.cpp Tue May 16 22:07:53 2006
@@ -23,6 +23,14 @@
*
* @author Roshan Weerasuriya (roshan@opensource.lk, roshanw@jkcsworld.com)
*/
+/* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! */
+/* 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 <string>
#include <iostream>
@@ -47,9 +55,7 @@
// Set the endpoint from command line argument if set
if (argc > 1)
- {
strcpy(endpoint, argv[1]);
- }
/*Set for HTTP transport */
InteropTestPortType ws(endpoint, APTHTTP1_1);
@@ -58,45 +64,35 @@
ws.setTransportProperty("SOAPAction", "InteropBase#echoString");
cout << "invoking echoString..." << endl;
- //testing echoString
+ //testing echoString
bool bSuccess = false;
- int iRetryIterationCount = 3;
+ int iRetryIterationCount = 3;
do
{
try
{
if (0 == strcmp(ws.echoString("hello world"), "hello world"))
- {
cout << "successful" << endl;
- }
else
- {
cout << "failed" << endl;
- }
bSuccess = true;
}
- catch(AxisException& e)
+ catch(AxisException& e)
{
bool bSilent = false;
if( e.getExceptionCode() == CLIENT_TRANSPORT_OPEN_CONNECTION_FAILED)
{
if( iRetryIterationCount > 0)
- {
bSilent = true;
- }
}
else
- {
iRetryIterationCount = 0;
- }
if( !bSilent)
- {
cout << "AxisException : " << e.what() << endl;
- }
}
catch(exception& e)
{
@@ -107,14 +103,14 @@
cout << "Unknown exception" << endl;
}
- iRetryIterationCount--;
+ iRetryIterationCount--;
} while( iRetryIterationCount > 0 && !bSuccess);
cout << "Test transport property accessors" << endl;
cout << "First transport key = ";
cout << ws.getFirstTransportPropertyKey(false) << endl;
cout << "First transport value = ";
- cout << ws.getCurrentTransportPropertyValue(false) << endl;
+ cout << ws.getCurrentTransportPropertyValue(false) << endl;
const char *key = NULL;
int count = 1;
while (key = ws.getNextTransportPropertyKey(false))
@@ -137,13 +133,9 @@
try
{
if (0 == strcmp(ws.echoString("hello world"), "hello world"))
- {
cout << "successful" << endl;
- }
else
- {
cout << "failed" << endl;
- }
bSuccess = true;
}
@@ -154,19 +146,13 @@
if( e.getExceptionCode() == CLIENT_TRANSPORT_OPEN_CONNECTION_FAILED)
{
if( iRetryIterationCount > 0)
- {
bSilent = true;
- }
}
else
- {
iRetryIterationCount = 0;
- }
if( !bSilent)
- {
cout << "AxisException : " << e.what() << endl;
- }
}
catch(exception& e)
{
@@ -177,7 +163,7 @@
cout << "Unknown exception" << endl;
}
- iRetryIterationCount--;
+ iRetryIterationCount--;
} while( iRetryIterationCount > 0 && !bSuccess);
Modified: webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/RpcHttpHeaderTest7Client.cpp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/RpcHttpHeaderTest7Client.cpp?rev=407158&r1=407157&r2=407158&view=diff
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/RpcHttpHeaderTest7Client.cpp (original)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/RpcHttpHeaderTest7Client.cpp Tue May 16 22:07:53 2006
@@ -23,6 +23,14 @@
*
* @author Roshan Weerasuriya (roshan@opensource.lk, roshanw@jkcsworld.com)
*/
+/* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! */
+/* 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 <string>
#include <iostream>
@@ -47,9 +55,7 @@
// Set the endpoint from command line argument if set
if (argc > 1)
- {
strcpy(endpoint, argv[1]);
- }
/*Set for HTTP transport */
InteropTestPortType ws(endpoint, APTHTTP1_1);
@@ -58,7 +64,7 @@
ws.setTransportProperty("Accept-Language", NULL);
cout << "invoking echoString..." << endl;
- //testing echoString
+ //testing echoString
bool bSuccess = false;
int iRetryIterationCount = 3;
@@ -67,36 +73,26 @@
try
{
if (0 == strcmp(ws.echoString("hello world"), "hello world"))
- {
cout << "successful" << endl;
- }
else
- {
cout << "failed" << endl;
- }
bSuccess = true;
}
- catch(AxisException& e)
+ catch(AxisException& e)
{
bool bSilent = false;
if( e.getExceptionCode() == CLIENT_TRANSPORT_OPEN_CONNECTION_FAILED)
{
if( iRetryIterationCount > 0)
- {
bSilent = true;
- }
}
else
- {
iRetryIterationCount = 0;
- }
if( !bSilent)
- {
cout << "AxisException : " << e.what() << endl;
- }
}
catch(exception& e)
{
@@ -114,7 +110,7 @@
cout << "First transport key = ";
cout << ws.getFirstTransportPropertyKey(false) << endl;
cout << "First transport value = ";
- cout << ws.getCurrentTransportPropertyValue(false) << endl;
+ cout << ws.getCurrentTransportPropertyValue(false) << endl;
const char *key = NULL;
int count = 1;
while (key = ws.getNextTransportPropertyKey(false))
@@ -137,13 +133,9 @@
try
{
if (0 == strcmp(ws.echoString("hello world"), "hello world"))
- {
cout << "successful" << endl;
- }
else
- {
cout << "failed" << endl;
- }
bSuccess = true;
}
@@ -154,19 +146,13 @@
if( e.getExceptionCode() == CLIENT_TRANSPORT_OPEN_CONNECTION_FAILED)
{
if( iRetryIterationCount > 0)
- {
bSilent = true;
- }
}
else
- {
iRetryIterationCount = 0;
- }
if( !bSilent)
- {
cout << "AxisException : " << e.what() << endl;
- }
}
catch(exception& e)
{
@@ -176,7 +162,7 @@
{
cout << "Unknown exception" << endl;
}
- iRetryIterationCount--;
+ iRetryIterationCount--;
} while( iRetryIterationCount > 0 && !bSuccess);
cout << "HTTP Header test end" << endl;
Modified: webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/RpcHttpHeaderTest8Client.cpp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/RpcHttpHeaderTest8Client.cpp?rev=407158&r1=407157&r2=407158&view=diff
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/RpcHttpHeaderTest8Client.cpp (original)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/RpcHttpHeaderTest8Client.cpp Tue May 16 22:07:53 2006
@@ -22,6 +22,14 @@
*
* @author Roshan Weerasuriya (roshan@opensource.lk, roshanw@jkcsworld.com)
*/
+/* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! */
+/* 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 <string>
#include <iostream>
@@ -37,92 +45,76 @@
char endpoint[256];
const char * server = "localhost";
const char * port = "80";
-
+
//endpoint for Axis CPP sample
sprintf( endpoint, "http://%s:%s/axis/base", server, port);
-
- // Set the endpoint from command line argument if set
- if( argc > 1)
- {
- strcpy( endpoint, argv[1]);
- }
-
- /*Set for HTTP transport */
+
+ // Set the endpoint from command line argument if set
+ if( argc > 1)
+ strcpy( endpoint, argv[1]);
+
+ /*Set for HTTP transport */
InteropTestPortType ws( endpoint, APTHTTP1_1);
- ws.setTransportProperty( "SOAPAction" , "InteropBase#echoString");
+ ws.setTransportProperty( "SOAPAction" , "InteropBase#echoString");
//set HTTP headers
- ws.setTransportProperty( NULL, "lang2");
+ ws.setTransportProperty( NULL, "lang2");
cout << "invoking echoString..." << endl;
- //testing echoString
- bool bSuccess = false;
- int iRetryIterationCount = 3;
-
- do
- {
- try
- {
- if (0 == strcmp( ws.echoString( "hello world"), "hello world"))
- {
- cout << "successful" << endl;
- }
- else
- {
- cout << "failed" << 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 << e.what() << endl;
- }
- }
- catch( ...)
- {
- cout << "Unknown exception" << endl;
- }
-
- iRetryIterationCount--;
- } while( iRetryIterationCount > 0 && !bSuccess);
-
- cout << "Test transport property accessors" << endl;
-
-// Extra lines added because printf in AIX dos not output (null) when the
-// parameter is NULL. This just forces the printf to output (null) when it is.
- char * pszPropertyKey = (char *) ws.getFirstTransportPropertyKey();
- char * pszPropertyValue = (char *) ws.getCurrentTransportPropertyValue();
+ //testing echoString
+ bool bSuccess = false;
+ int iRetryIterationCount = 3;
- if( pszPropertyKey == NULL)
+ do
+ {
+ try
{
- pszPropertyKey = "(null)";
+ if (0 == strcmp( ws.echoString( "hello world"), "hello world"))
+ cout << "successful" << endl;
+ else
+ cout << "failed" << 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( pszPropertyValue == NULL)
+ if( !bSilent)
+ cout << e.what() << endl;
+ }
+ catch( ...)
{
- pszPropertyValue = "(null)";
+ cout << "Unknown exception" << endl;
}
- cout << "First transport key = " << pszPropertyKey << endl;
+ iRetryIterationCount--;
+ } while( iRetryIterationCount > 0 && !bSuccess);
+
+ cout << "Test transport property accessors" << endl;
+
+ // Extra lines added because printf in AIX dos not output (null) when the parameter is NULL. This just forces the
+ // printf to output (null) when it is.
+ char * pszPropertyKey = (char *) ws.getFirstTransportPropertyKey();
+ char * pszPropertyValue = (char *) ws.getCurrentTransportPropertyValue();
+
+ if( pszPropertyKey == NULL)
+ pszPropertyKey = "(null)";
+
+ if( pszPropertyValue == NULL)
+ pszPropertyValue = "(null)";
+
+ cout << "First transport key = " << pszPropertyKey << endl;
cout << "First transport value = " << pszPropertyValue << endl;
const char *key = NULL;
@@ -130,8 +122,8 @@
while (key = ws.getNextTransportPropertyKey())
{
cout << "Next transport key = " << key << endl;
- cout << "Next transport value = " <<
- ws.getCurrentTransportPropertyValue() << endl;
+ cout << "Next transport value = " <<
+ ws.getCurrentTransportPropertyValue() << endl;
count++;
}
@@ -139,54 +131,45 @@
ws.deleteTransportProperty("Accept-Language");
//now the request should not have these removed headers
- bSuccess = false;
- iRetryIterationCount = 3;
+ bSuccess = false;
+ iRetryIterationCount = 3;
+
+ do
+ {
+ try
+ {
+ if( 0 == strcmp( ws.echoString( "hello world"), "hello world"))
+ cout << "successful" << endl;
+ else
+ cout << "failed" << endl;
- do
+ bSuccess = true;
+ }
+ catch( AxisException& e)
{
- try
- {
- if( 0 == strcmp( ws.echoString( "hello world"), "hello world"))
- {
- cout << "successful" << endl;
- }
- else
- {
- cout << "failed" << 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 << e.what() << endl;
- }
- }
- catch( ...)
- {
- cout << "Unknown exception" << endl;
- }
+ bool bSilent = false;
+
+ if( e.getExceptionCode() == CLIENT_TRANSPORT_OPEN_CONNECTION_FAILED)
+ {
+ if( iRetryIterationCount > 1)
+ bSilent = true;
+ }
+ else
+ iRetryIterationCount = 0;
- iRetryIterationCount--;
- } while( iRetryIterationCount > 0 && !bSuccess);
+ if( !bSilent)
+ cout << e.what() << endl;
+ }
+ catch( ...)
+ {
+ cout << "Unknown exception" << endl;
+ }
+
+ iRetryIterationCount--;
+ }
+ while( iRetryIterationCount > 0 && !bSuccess);
- cout << "HTTP Header test end" << endl;
+ cout << "HTTP Header test end" << endl;
return 0;
}