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/14 09:16:49 UTC
svn commit: r406277 - in
/webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp:
ComplexTypeAll1Client.cpp ComplexTypeAll2Client.cpp ComplexTypeAllClient.cpp
Author: nadiramra
Date: Sun May 14 00:16:46 2006
New Revision: 406277
URL: http://svn.apache.org/viewcvs?rev=406277&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/ComplexTypeAll1Client.cpp
webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/ComplexTypeAll2Client.cpp
webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/ComplexTypeAllClient.cpp
Modified: webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/ComplexTypeAll1Client.cpp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/ComplexTypeAll1Client.cpp?rev=406277&r1=406276&r2=406277&view=diff
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/ComplexTypeAll1Client.cpp (original)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/ComplexTypeAll1Client.cpp Sun May 14 00:16:46 2006
@@ -13,6 +13,17 @@
// 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 <axis/AxisException.hpp>
#include "operations.hpp"
@@ -32,105 +43,113 @@
int main(int argc, char* argv[])
{
-
- operations *ws;
- char *endpoint = WSDL_DEFAULT_ENDPOINT;
- bool endpoint_set = false;
- int returnValue = 1; // Assume Failure
-
- endpoint_set = parse_args_for_endpoint(&argc, argv, &endpoint);
-
- bool bSuccess = false;
- int iRetryIterationCount = 3;
-
- do
- {
- try {
-
- if(endpoint_set) {
- ws = new operations(endpoint, APTHTTP1_1);
- free(endpoint);
- endpoint_set = false;
- } else
- ws = new operations();
-
- aRecord* input=new aRecord();
-
- xsd__int* fieldone=new xsd__int();
- *fieldone=12345;
- input->field1=fieldone;
-
- input->field2 = "I'm still here!";
-
- xsd__byte* fieldthree=new xsd__byte();
- *fieldthree=65;
- input->field3=fieldthree;
-
- xsd__boolean result;
- result = ws->myOperation(input);
-
- if (result!= NULL)
- cout<< "Result= " << result << endl;
- else
- cout << "result is NULL" << endl;
-
- bSuccess = true;
-
- returnValue = 0; // Success
-
- } 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 << e.what() << endl;
- }
- } catch(exception& exception){
-
- cout << "Exception on clean up of ws : " << exception.what()<<endl;
-
- } catch(...) {
-
- cout << "Unknown Exception occured" << endl;
- }
-
- // Samisa : clean up memory allocated for stub
- 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);
+ operations *ws;
+
+ aRecord* input;
+ xsd__boolean result;
+
+ xsd__int fieldone;
+ xsd__byte fieldthree;
+
+
+ char *endpoint = WSDL_DEFAULT_ENDPOINT;
+ bool endpoint_set = false;
+ int returnValue = 1; // Assume Failure
+
+ endpoint_set = parse_args_for_endpoint(&argc, argv, &endpoint);
+
+ bool bSuccess = false;
+ int iRetryIterationCount = 3;
+
+ do
+ {
+ try
+ {
+
+ if(endpoint_set)
+ {
+ ws = new operations(endpoint, APTHTTP1_1);
+ free(endpoint);
+ endpoint_set = false;
+ }
+ else
+ ws = new operations();
+
+ input=new aRecord();
+
+ fieldone=12345;
+ input->field1= &fieldone;
+
+ input->field2 = "I'm still here!";
+
+ fieldthree=65;
+ input->field3=&fieldthree;
+
+ result = ws->myOperation(input);
+
+ if (result!= NULL)
+ cout<< "Result= " << result << endl;
+ else
+ cout << "result is NULL" << endl;
+
+ bSuccess = true;
+
+ returnValue = 0; // Success
+
+ }
+ 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 << e.what() << endl;
+ }
+ catch(exception& exception)
+ {
+
+ cout << "Exception on clean up of ws : " << exception.what()<<endl;
+
+ }
+ catch(...)
+ {
+
+ cout << "Unknown Exception occured" << endl;
+ }
+
+ // Samisa : clean up memory allocated for stub
+ 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);
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.
@@ -211,4 +230,4 @@
if(output_file.is_open()){
cout.rdbuf( output_file.rdbuf() );
}
-}
\ No newline at end of file
+}
Modified: webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/ComplexTypeAll2Client.cpp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/ComplexTypeAll2Client.cpp?rev=406277&r1=406276&r2=406277&view=diff
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/ComplexTypeAll2Client.cpp (original)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/ComplexTypeAll2Client.cpp Sun May 14 00:16:46 2006
@@ -13,6 +13,17 @@
// 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 <axis/AxisException.hpp>
#include "operations.hpp"
@@ -31,86 +42,93 @@
void setLogOptions(const char *output_filename);
int main(int argc, char* argv[])
-{
- operations *ws;
+{
+ operations *ws;
+
+ aRecord* input;
+ aRecord* result;
- char *endpoint = WSDL_DEFAULT_ENDPOINT;
- bool endpoint_set = false;
- int returnValue = 1; // Assume Failure
-
- endpoint_set = parse_args_for_endpoint(&argc, argv, &endpoint);
-
- bool bSuccess = false;
- int iRetryIterationCount = 3;
-
- do
- {
- try {
- if(endpoint_set) {
- ws = new operations(endpoint, APTHTTP1_1);
- free(endpoint);
- endpoint_set = false;
- } else
- ws = new operations();
-
- aRecord* input = new aRecord();
- input->field1 = "Hello World!";
- input->field2 = "I'm still here!";
- input->field3 = "Now I go!";
- aRecord* result = NULL;
- result = ws->myOperation(input);
-
- cout << "Result field1 is = " << result->field1 << endl;
- cout << "Result field2 is = " << result->field2 << endl;
- cout << "Result field3 is = " << result->field3 << endl;
-
- bSuccess = true;
-
- returnValue = 0; // Success
-
- } catch(AxisException &e) {
- bool bSilent = false;
-
- if( e.getExceptionCode() == CLIENT_TRANSPORT_OPEN_CONNECTION_FAILED)
- {
- if( iRetryIterationCount > 0)
- {
- bSilent = true;
- }
- }
- else
- {
- iRetryIterationCount = 0;
- }
+ char *endpoint = WSDL_DEFAULT_ENDPOINT;
+ bool endpoint_set = false;
+ int returnValue = 1; // Assume Failure
+
+ endpoint_set = parse_args_for_endpoint(&argc, argv, &endpoint);
+
+ bool bSuccess = false;
+ int iRetryIterationCount = 3;
+
+ do
+ {
+ try
+ {
+ if(endpoint_set)
+ {
+ ws = new operations(endpoint, APTHTTP1_1);
+ free(endpoint);
+ endpoint_set = false;
+ }
+ else
+ ws = new operations();
+
+ input = new aRecord();
+ input->field1 = "Hello World!";
+ input->field2 = "I'm still here!";
+ input->field3 = "Now I go!";
+
+ result = ws->myOperation(input);
+
+ cout << "Result field1 is = " << result->field1 << endl;
+ cout << "Result field2 is = " << result->field2 << endl;
+ cout << "Result field3 is = " << result->field3 << endl;
+
+ bSuccess = true;
+
+ returnValue = 0; // Success
+
+ }
+ 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 << e.what() << endl;
- }
- } catch(...) {
- cout << "Unknown Exception occured." << endl;
- }
-
- // Samisa : clean up memory allocated for stub
- 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);
+ 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);
+
if(endpoint_set)
- free(endpoint);
- cout << "---------------------- TEST COMPLETE -----------------------------"<< endl;
+ free(endpoint);
+ cout << "---------------------- TEST COMPLETE -----------------------------"<< endl;
- return returnValue;
+ return returnValue;
}
/* Spin through args list and check for -e -p and -s options.
Modified: webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/ComplexTypeAllClient.cpp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/ComplexTypeAllClient.cpp?rev=406277&r1=406276&r2=406277&view=diff
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/ComplexTypeAllClient.cpp (original)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/ComplexTypeAllClient.cpp Sun May 14 00:16:46 2006
@@ -13,6 +13,17 @@
// 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 <axis/AxisException.hpp>
#include "operations.hpp"
@@ -31,84 +42,92 @@
void setLogOptions(const char *output_filename);
int main(int argc, char* argv[])
-{
- operations *ws;
+{
+ operations *ws;
+
+ aRecord* input;
+ xsd__boolean result;
- char *endpoint = WSDL_DEFAULT_ENDPOINT;
- bool endpoint_set = false;
- int returnValue = 1; // Assume Failure
-
- endpoint_set = parse_args_for_endpoint(&argc, argv, &endpoint);
-
- bool bSuccess = false;
- int iRetryIterationCount = 3;
-
- do
- {
- try {
- if(endpoint_set) {
- ws = new operations(endpoint, APTHTTP1_1);
- free(endpoint);
- endpoint_set = false;
- } else
- ws = new operations();
-
- aRecord* input = new aRecord();
- input->field1 = "Hello World!";
- input->field2 = "I'm still here!";
- input->field3 = "Now I go!";
- xsd__boolean result = (xsd__boolean)0;
- result = ws->myOperation(input);
-
- cout << "Result " << result << endl;
-
- bSuccess = true;
-
- returnValue = 0; // Success
-
- } catch(AxisException &e) {
- bool bSilent = false;
-
- if( e.getExceptionCode() == CLIENT_TRANSPORT_OPEN_CONNECTION_FAILED)
- {
- if( iRetryIterationCount > 0)
- {
- bSilent = true;
- }
- }
- else
- {
- iRetryIterationCount = 0;
- }
+ char *endpoint = WSDL_DEFAULT_ENDPOINT;
+ bool endpoint_set = false;
+ int returnValue = 1; // Assume Failure
+
+ endpoint_set = parse_args_for_endpoint(&argc, argv, &endpoint);
+
+ bool bSuccess = false;
+ int iRetryIterationCount = 3;
+
+ do
+ {
+ try
+ {
+ if(endpoint_set)
+ {
+ ws = new operations(endpoint, APTHTTP1_1);
+ free(endpoint);
+ endpoint_set = false;
+ }
+ else
+ ws = new operations();
+
+ input = new aRecord();
+ input->field1 = "Hello World!";
+ input->field2 = "I'm still here!";
+ input->field3 = "Now I go!";
+ result = (xsd__boolean)0;
+
+ result = ws->myOperation(input);
+
+ cout << "Result " << result << endl;
+
+ bSuccess = true;
+
+ returnValue = 0; // Success
+
+ }
+ 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 << e.what() << endl;
- }
- } catch(...) {
- cout << "Unknown Exception occured." << endl;
- }
-
- // Samisa : clean up memory allocated for stub
- 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);
+ 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);
+
if(endpoint_set)
- free(endpoint);
- cout << "---------------------- TEST COMPLETE -----------------------------"<< endl;
+ free(endpoint);
+
+ cout << "---------------------- TEST COMPLETE -----------------------------"<< endl;
- return returnValue;
+ return returnValue;
}
/* Spin through args list and check for -e -p and -s options.