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/09 05:53:19 UTC
svn commit: r405295 - in
/webservices/axis/trunk/c/tests/auto_build/testcases: client/c/ client/cpp/
tests/
Author: nadiramra
Date: Mon May 8 20:53:18 2006
New Revision: 405295
URL: http://svn.apache.org/viewcvs?rev=405295&view=rev
Log:
C support fixes/enhancements. Testcases for C bindings.
Added:
webservices/axis/trunk/c/tests/auto_build/testcases/client/c/XSD_nonNegativeIntegerClient.c
webservices/axis/trunk/c/tests/auto_build/testcases/client/c/XSD_nonPositiveIntegerClient.c
webservices/axis/trunk/c/tests/auto_build/testcases/client/c/XSD_normalizedStringClient.c
webservices/axis/trunk/c/tests/auto_build/testcases/tests/XSD_nonNegativeIntegerC.xml
webservices/axis/trunk/c/tests/auto_build/testcases/tests/XSD_nonPositiveIntegerC.xml
webservices/axis/trunk/c/tests/auto_build/testcases/tests/XSD_normalizedStringC.xml
Modified:
webservices/axis/trunk/c/tests/auto_build/testcases/client/c/XSD_positiveIntegerClient.c
webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_nonNegativeIntegerClient.cpp
webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_nonPositiveIntegerClient.cpp
webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_normalizedStringClient.cpp
Added: webservices/axis/trunk/c/tests/auto_build/testcases/client/c/XSD_nonNegativeIntegerClient.c
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/client/c/XSD_nonNegativeIntegerClient.c?rev=405295&view=auto
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/client/c/XSD_nonNegativeIntegerClient.c (added)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/client/c/XSD_nonNegativeIntegerClient.c Mon May 8 20:53:18 2006
@@ -0,0 +1,153 @@
+// Copyright 2003-2004 The Apache Software Foundation.
+// (c) Copyright IBM Corp. 2004, 2005 All Rights Reserved
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include <stdlib.h>
+#include <stdio.h>
+
+#include "CommonClientTestCode.h"
+#include "XSD_nonNegativeInteger.h"
+
+int main(int argc, char* argv[])
+{
+ AXISCHANDLE ws;
+
+ xsdc__nonNegativeInteger result;
+ xsdc__nonNegativeInteger input;
+ xsdc__nonNegativeInteger* nillableResult;
+
+ char endpoint[256];
+ const char* url="http://localhost:80/axis/XSD_nonNegativeInteger";
+
+ if(argc>1)
+ url = argv[1];
+
+ sprintf(endpoint, "%s", url);
+ ws = get_XSD_nonNegativeInteger_stub(endpoint);
+
+ result = asNonNillableElement(ws, (xsdc__nonNegativeInteger) UNSIGNED_LONGLONGVALUE(18446744073709551615));
+ printf( "non-nillable element=%llu\n" , result );
+
+ result = asNonNillableElement(ws, (xsdc__nonNegativeInteger)1);
+ printf( "non-nillable element=%llu\n" , result );
+
+ result = asNonNillableElement(ws, (xsdc__nonNegativeInteger)0);
+ printf( "non-nillable element=%llu\n" , result );
+
+
+ // Test nillable element, with a value
+ input = (xsdc__nonNegativeInteger)123456789;
+ nillableResult = asNillableElement(ws, &input);
+ if (nillableResult)
+ {
+ printf( "nillable element=%llu\n" , *(nillableResult) );
+ axiscAxisDelete(nillableResult, XSDC_NONNEGATIVEINTEGER);
+ }
+ else
+ printf( "nillable element=<nil>\n" );
+
+ // Test nillable element, with nil
+ nillableResult = asNillableElement(ws, NULL);
+ if (nillableResult)
+ {
+ printf( "nil element=%llu\n" , *(nillableResult) );
+ axiscAxisDelete(nillableResult, XSDC_NONNEGATIVEINTEGER);
+ }
+ else
+ printf( "nil element=<nil>\n" );
+
+ // Test required attribute
+ {
+ RequiredAttributeElement requiredAttributeInput;
+ RequiredAttributeElement* requiredAttributeResult;
+
+ requiredAttributeInput.requiredAttribute =123456789;
+ requiredAttributeResult = asRequiredAttribute(ws, &requiredAttributeInput);
+ printf( "required attribute=%llu\n" , requiredAttributeResult->requiredAttribute );
+ Axis_Delete_RequiredAttributeElement(requiredAttributeResult, 0);
+ }
+
+/* Optional Attributes currently unsupported by WSDL2Ws
+ * Exact coding of this section may change depending on chosen implementation
+ // Test optional attribute, with a value
+ OptionalAttributeElement optionalAttributeInput;
+ optionalAttributeInput.setoptionalAttribute(123456789);
+ OptionalAttributeElement* optionalAttributeResult = asOptionalAttribute(&optionalAttributeInput);
+ if (optionalAttributeResult->getoptionalAttribute())
+ printf( "optional attribute, with data=" , optionalAttributeResult->getoptionalAttribute() );
+ else
+ printf( "optional attribute, with data=<not present>\n" );
+ delete optionalAttributeResult;
+
+ // Test optional attribute, not present
+ optionalAttributeInput.setattribute();
+ optionalAttributeResult = asOptionalAttribute(&optionalAttributeInput);
+ if (optionalAttributeResult->getoptionalAttribute())
+ printf( "optional attribute, not present=" , optionalAttributeResult->getoptionalAttribute() );
+ else
+ printf( "optional attribute, not present=<not present>\n" );
+ delete optionalAttributeResult;
+*/
+
+ // Test array
+ {
+#define ARRAY_SIZE 2
+ int i, outputSize=0;
+
+ xsdc__nonNegativeInteger_Array arrayInput;
+ xsdc__nonNegativeInteger_Array* arrayResult;
+ xsdc__nonNegativeInteger *array[ARRAY_SIZE];
+ xsdc__nonNegativeInteger ** output;
+
+ input = 123456789;
+ for (i=0 ; i < ARRAY_SIZE ; i++)
+ array[i] = &input;
+
+ arrayInput.m_Array = array;
+ arrayInput.m_Size = ARRAY_SIZE;
+ arrayInput.m_Type = XSDC_NONNEGATIVEINTEGER;
+
+ arrayResult = asArray(ws, &arrayInput);
+
+ if (arrayResult)
+ {
+ output = arrayResult->m_Array;
+ outputSize = arrayResult->m_Size;
+ }
+
+ printf("array of %d elements\n" , outputSize );
+ for (i = 0; i < outputSize ; i++)
+ printf( " element[%d]=%llu\n", i , *((xsdc__nonNegativeInteger*)(output[i])) );
+
+ axiscAxisDelete(arrayResult, XSDC_ARRAY);
+ }
+
+ // Test complex type
+ {
+ SimpleComplexType complexTypeInput;
+ SimpleComplexType* complexTypeResult;
+
+ complexTypeInput.complexTypeElement =123456789;
+ complexTypeResult = asComplexType(ws, &complexTypeInput);
+ printf( "within complex type=%llu\n", complexTypeResult->complexTypeElement );
+ Axis_Delete_SimpleComplexType(complexTypeResult, 0);
+ }
+
+ // Tests now complete
+ destroy_XSD_nonNegativeInteger_stub(ws);
+
+ printf("---------------------- TEST COMPLETE -----------------------------\n");
+
+ return 0;
+}
Added: webservices/axis/trunk/c/tests/auto_build/testcases/client/c/XSD_nonPositiveIntegerClient.c
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/client/c/XSD_nonPositiveIntegerClient.c?rev=405295&view=auto
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/client/c/XSD_nonPositiveIntegerClient.c (added)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/client/c/XSD_nonPositiveIntegerClient.c Mon May 8 20:53:18 2006
@@ -0,0 +1,163 @@
+// Copyright 2003-2004 The Apache Software Foundation.
+// (c) Copyright IBM Corp. 2004, 2005 All Rights Reserved
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include <stdlib.h>
+#include <stdio.h>
+
+#include "CommonClientTestCode.h"
+#include "XSD_nonPositiveInteger.h"
+
+int main(int argc, char* argv[])
+{
+ AXISCHANDLE ws;
+
+ xsdc__nonPositiveInteger result;
+ xsdc__nonPositiveInteger input;
+ xsdc__nonPositiveInteger* nillableResult;
+
+ char endpoint[256];
+ const char* url="http://localhost:80/axis/XSD_nonPositiveInteger";
+
+ if(argc>1)
+ url = argv[1];
+
+
+ // Note: All values are unsigned, but considered to be negative.
+ sprintf(endpoint, "%s", url);
+ ws = get_XSD_nonPositiveInteger_stub(endpoint);
+
+ result = asNonNillableElement(ws, (xsdc__nonPositiveInteger) LONGLONGVALUE(-9223372036854775808));
+ printf( "non-nillable element=%lld\n", result );
+
+ result = asNonNillableElement(ws, (xsdc__nonPositiveInteger)-1);
+ printf( "non-nillable element=%lld\n", result );
+
+ result = asNonNillableElement(ws, (xsdc__nonPositiveInteger)0);
+ printf( "non-nillable element=%lld\n", result );
+ /*
+ * Test client correctly handles server response data beginning with '-'
+ * which is also permitted for nonPositiveInteger.
+ */
+ result = asNonNillableElement(ws, (xsdc__nonPositiveInteger)-123456789);
+ printf( "non-nillable element=%lld\n", result );
+
+
+ // Test nillable element, with a value
+ input = (xsdc__nonPositiveInteger)-123456789;
+ nillableResult = asNillableElement(ws, &input);
+ if (nillableResult)
+ {
+ printf( "nillable element=%lld\n", *(nillableResult) );
+ axiscAxisDelete(nillableResult, XSDC_NONPOSITIVEINTEGER);
+ }
+ else
+ printf( "nillable element=<nil>\n" );
+
+ // Test nillable element, with nil
+ nillableResult = asNillableElement(ws, NULL);
+ if (nillableResult)
+ {
+ printf( "nil element=%lld\n", *(nillableResult) );
+ axiscAxisDelete(nillableResult, XSDC_NONPOSITIVEINTEGER);
+ }
+ else
+ printf( "nil element=<nil>\n" );
+
+ // Test required attribute
+ {
+ RequiredAttributeElement requiredAttributeInput;
+ RequiredAttributeElement* requiredAttributeResult;
+
+ requiredAttributeInput.requiredAttribute = -123456789;
+ requiredAttributeResult = asRequiredAttribute(ws, &requiredAttributeInput);
+ printf( "required attribute=%lld\n", requiredAttributeResult->requiredAttribute);
+ Axis_Delete_RequiredAttributeElement(requiredAttributeResult, 0);
+ }
+
+/* Optional Attributes currently unsupported by WSDL2Ws
+ * Exact coding of this section may change depending on chosen implementation
+ // Test optional attribute, with a value
+ OptionalAttributeElement optionalAttributeInput;
+ optionalAttributeInput.setoptionalAttribute(-123456789);
+ OptionalAttributeElement* optionalAttributeResult = asOptionalAttribute(&optionalAttributeInput);
+ if (optionalAttributeResult->getoptionalAttribute())
+ printf( "optional attribute, with data=" << optionalAttributeResult->getoptionalAttribute() );
+ else
+ printf( "optional attribute, with data=<not present>\n" );
+ delete optionalAttributeResult;
+
+ // Test optional attribute, not present
+ optionalAttributeInput.setattribute();
+ optionalAttributeResult = asOptionalAttribute(&optionalAttributeInput);
+ if (optionalAttributeResult->getoptionalAttribute())
+ printf( "optional attribute, not present=" << optionalAttributeResult->getoptionalAttribute() );
+ else
+ printf( "optional attribute, not present=<not present>\n" );
+ delete optionalAttributeResult;
+*/
+
+ // Test array
+ {
+#define ARRAY_SIZE 2
+ int i, outputSize=0;
+
+ xsdc__nonPositiveInteger_Array arrayInput;
+ xsdc__nonPositiveInteger_Array* arrayResult;
+ xsdc__nonPositiveInteger *array[ARRAY_SIZE];
+ xsdc__nonPositiveInteger ** output;
+
+ input = -123456789;
+ for (i=0 ; i < ARRAY_SIZE ; i++)
+ array[i] = &input;
+
+ arrayInput.m_Array = array;
+ arrayInput.m_Size = ARRAY_SIZE;
+ arrayInput.m_Type = XSDC_NONPOSITIVEINTEGER;
+
+ arrayResult = asArray(ws, &arrayInput);
+
+ if (arrayResult)
+ {
+ output = arrayResult->m_Array;
+ outputSize = arrayResult->m_Size;
+ }
+
+ printf("array of %d elements\n" , outputSize );
+
+ for (i = 0; i < outputSize ; i++)
+ printf( " element[%d]=%lld\n", i, *((xsdc__nonPositiveInteger*)(output[i])) );
+
+ axiscAxisDelete(arrayResult, XSDC_ARRAY);
+ }
+
+
+ // Test complex type
+ {
+ SimpleComplexType complexTypeInput;
+ SimpleComplexType* complexTypeResult;
+
+ complexTypeInput.complexTypeElement = -123456789;
+ complexTypeResult = asComplexType(ws, &complexTypeInput);
+ printf( "within complex type=%lld\n", complexTypeResult->complexTypeElement );
+ Axis_Delete_SimpleComplexType(complexTypeResult, 0);
+ }
+
+ // Tests now complete
+ destroy_XSD_nonPositiveInteger_stub(ws);
+
+ printf( "---------------------- TEST COMPLETE -----------------------------\n");
+
+ return 0;
+}
Added: webservices/axis/trunk/c/tests/auto_build/testcases/client/c/XSD_normalizedStringClient.c
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/client/c/XSD_normalizedStringClient.c?rev=405295&view=auto
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/client/c/XSD_normalizedStringClient.c (added)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/client/c/XSD_normalizedStringClient.c Mon May 8 20:53:18 2006
@@ -0,0 +1,289 @@
+// Copyright 2003-2004 The Apache Software Foundation.
+// (c) Copyright IBM Corp. 2004, 2005 All Rights Reserved
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include <stdlib.h>
+#include <stdio.h>
+
+#include "CommonClientTestCode.h"
+#include "XSD_normalizedString.h"
+
+
+int main(int argc, char* argv[])
+{
+ AXISCHANDLE ws;
+
+ xsdc__normalizedString input;
+ xsdc__normalizedString result;
+
+ RequiredAttributeElement requiredAttributeInput;
+ RequiredAttributeElement* requiredAttributeResult;
+
+ char simplenormalizedString[25] = "A simple test message!";
+ char emptynormalizedString[1] = "";
+ char reservedCharactersnormalizedString[] = "<>&\"\'";
+ char whitespacenormalizedString[] = " \t\r\nsome text \t\r\nmore text \t\r\n";
+
+ char endpoint[256];
+ const char* url="http://localhost:80/axis/XSD_normalizedString";
+
+ if(argc>1)
+ url = argv[1];
+
+ sprintf(endpoint, "%s", url);
+ ws = get_XSD_normalizedString_stub(endpoint);
+
+ // Test non-nillable element
+ result = asNonNillableElement(ws, simplenormalizedString);
+ if (result)
+ {
+ if (*result)
+ printf( "non-nillable element=%s\n" , result );
+ else
+ printf( "non-nillable element=<empty>\n" );
+ axiscAxisDelete(result, XSDC_NORMALIZEDSTRING);
+ }
+ else
+ printf( "non-nillable element=<nil>\n" );
+
+ // Test empty non-nillable element
+ result = asNonNillableElement(ws, emptynormalizedString);
+ if (result)
+ {
+ if (*result)
+ printf( "empty non-nillable element=%s\n" , result );
+ else
+ printf( "empty non-nillable element=<empty>\n" );
+ axiscAxisDelete(result, XSDC_NORMALIZEDSTRING);
+ }
+ else
+ printf( "empty non-nillable element=<nil>\n" );
+
+ // Test non-nillable element with XML reserved characters
+ result = asNonNillableElement(ws, reservedCharactersnormalizedString);
+ if (result)
+ {
+ if (*result)
+ printf( "non-nillable element with XML reserved characters=%s\n" , result );
+ else
+ printf( "non-nillable element with XML reserved characters=<empty>\n" );
+ axiscAxisDelete(result, XSDC_NORMALIZEDSTRING);
+ }
+ else
+ printf( "non-nillable element with XML reserved characters=<nil>\n" );
+
+ // Test non-nillable element with XML reserved characters
+ result = asNonNillableElement(ws, whitespacenormalizedString);
+ if (result)
+ {
+ if (*result)
+ printf( "non-nillable element with whitespace characters=\"%s\"\n", result );
+ else
+ printf( "non-nillable element with whitespace characters=<empty>\n" );
+ axiscAxisDelete(result, XSDC_NORMALIZEDSTRING);
+ }
+ else
+ printf( "non-nillable element with whitespace characters=<nil>\n" );
+
+ // Test nillable element, with a value
+ result = asNillableElement(ws, simplenormalizedString);
+ if (result)
+ {
+ if (*result)
+ printf( "nillable element=%s\n" , result );
+ else
+ printf( "nillable element=<empty>\n" );
+ axiscAxisDelete(result, XSDC_NORMALIZEDSTRING);
+ }
+ else
+ printf( "nillable element=<nil>\n" );
+
+ // Test empty nillable element
+ result = asNillableElement(ws, emptynormalizedString);
+ if (result)
+ {
+ if (*result)
+ printf( "empty nillable element=%s\n" , result );
+ else
+ printf( "empty nillable element=<empty>\n" );
+ axiscAxisDelete(result, XSDC_NORMALIZEDSTRING);
+ }
+ else
+ printf( "empty nillable element=<nil>\n" );
+
+ // Test nillable element, with nil
+ result = asNillableElement(ws, NULL);
+ if (result)
+ {
+ if (*result)
+ printf( "nil element=%s\n" , result );
+ else
+ printf( "nil element=<empty>\n" );
+ axiscAxisDelete(result, XSDC_NORMALIZEDSTRING);
+ }
+ else
+ printf( "nil element=<nil>\n" );
+
+ // Test required attribute
+ requiredAttributeInput.requiredAttribute = simplenormalizedString;
+ requiredAttributeResult = asRequiredAttribute(ws, &requiredAttributeInput);
+ if (requiredAttributeResult->requiredAttribute)
+ {
+ if (*(requiredAttributeResult->requiredAttribute))
+ printf( "required attribute=%s\n" , requiredAttributeResult->requiredAttribute);
+ else
+ printf( "required attribute=<empty>\n" );
+ }
+ else
+ printf( "required attribute=<nil>\n" );
+ Axis_Delete_RequiredAttributeElement(requiredAttributeResult, 0);
+
+ // Test empty required attribute
+ requiredAttributeInput.requiredAttribute = emptynormalizedString;
+ requiredAttributeResult = asRequiredAttribute(ws, &requiredAttributeInput);
+ if (requiredAttributeResult->requiredAttribute)
+ {
+ if (*(requiredAttributeResult->requiredAttribute))
+ printf( "empty required attribute=%s\n" , requiredAttributeResult->requiredAttribute);
+ else
+ printf( "empty required attribute=<empty>\n" );
+ }
+ else
+ printf( "empty required attribute=<nil>\n" );
+ Axis_Delete_RequiredAttributeElement(requiredAttributeResult, 0);
+
+/* Optional Attributes currently unsupported by WSDL2Ws
+ * Exact coding of this section may change depending on chosen implementation
+ // Test optional attribute, with a value
+ input = new char[25];
+ strcpy (input, simplenormalizedString);
+ OptionalAttributeElement optionalAttributeInput;
+ optionalAttributeInput.setoptionalAttribute(input);
+ OptionalAttributeElement* optionalAttributeResult = asOptionalAttribute(&optionalAttributeInput);
+ if (optionalAttributeResult->getoptionalAttribute())
+ {
+ if (*(optionalAttributeResult->getoptionalAttribute()))
+ printf( "optional attribute, with data=" , optionalAttributeResult->getoptionalAttribute() );
+ else
+ printf( "optional attribute, with data=<empty>\n" );
+ }
+ else
+ printf( "optional attribute, with data=<not present>\n" );
+ delete [] input;
+ delete optionalAttributeResult;
+
+ // Test empty optional attribute
+ input = new char[1];
+ strcpy (input, emptynormalizedString);
+ optionalAttributeInput.setoptionalAttribute(input);
+ optionalAttributeResult = asOptionalAttribute(&optionalAttributeInput);
+ if (optionalAttributeResult->getoptionalAttribute())
+ {
+ if (*(optionalAttributeResult->getoptionalAttribute()))
+ printf( "empty optional attribute=" , optionalAttributeResult->getoptionalAttribute() );
+ else
+ printf( "empty optional attribute=<empty>\n" );
+ }
+ else
+ printf( "empty optional attribute=<not present>\n" );
+ delete [] input;
+ delete optionalAttributeResult;
+
+ // Test optional attribute, not present
+ // optionalAttributeInput.setattribute();
+ optionalAttributeResult = asOptionalAttribute(&optionalAttributeInput);
+ if (optionalAttributeResult->getoptionalAttribute())
+ {
+ if (*(optionalAttributeResult->getoptionalAttribute()))
+ printf( "optional attribute, not present=" , optionalAttributeResult->getoptionalAttribute() );
+ else
+ printf( "optional attribute, not present=<empty>\n" );
+ }
+ else
+ printf( "optional attribute, not present=<not present>\n" );
+ delete optionalAttributeResult;
+*/
+
+ // Test array
+ {
+#define ARRAY_SIZE 2
+ int i, outputSize=0;
+
+ xsdc__normalizedString_Array arrayInput;
+ xsdc__normalizedString_Array* arrayResult;
+ xsdc__normalizedString array[ARRAY_SIZE];
+ xsdc__normalizedString * output;
+
+ for (i=0 ; i < ARRAY_SIZE ; i++)
+ array[i] = simplenormalizedString;
+
+ arrayInput.m_Array = array;
+ arrayInput.m_Size = ARRAY_SIZE;
+ arrayInput.m_Type = XSDC_NORMALIZEDSTRING;
+
+ arrayResult = asArray(ws, &arrayInput);
+
+ if (arrayResult)
+ {
+ output = arrayResult->m_Array;
+ outputSize = arrayResult->m_Size;
+ }
+
+ printf("array of %d elements\n" , outputSize );
+ for (i = 0; i < outputSize ; i++)
+ {
+ if (output != NULL)
+ {
+ if (output[i]!=NULL)
+ printf( " element[%d]=%s\n", i , output[i] );
+ else
+ printf( " element[%d]=<empty>\n", i );
+ }
+ else
+ printf( " element[%d]=<nil>\n", i );
+ }
+
+ axiscAxisDelete(arrayResult, XSDC_ARRAY);
+ }
+
+
+
+
+
+ // Test complex type
+ {
+ SimpleComplexType complexTypeInput;
+ SimpleComplexType* complexTypeResult;
+
+ complexTypeInput.complexTypeElement = simplenormalizedString;
+ complexTypeResult = asComplexType(ws, &complexTypeInput);
+ if (complexTypeResult->complexTypeElement)
+ {
+ if (*(complexTypeResult->complexTypeElement))
+ printf( "within complex type=%s\n" , complexTypeResult->complexTypeElement );
+ else
+ printf( "within complex type=<empty>\n" );
+ }
+ else
+ printf( "within complex type=<nil>\n" );
+ Axis_Delete_SimpleComplexType(complexTypeResult, 0);
+ }
+
+ // Tests now complete
+ destroy_XSD_normalizedString_stub(ws);
+
+ printf( "---------------------- TEST COMPLETE -----------------------------\n");
+
+ return 0;
+}
Modified: webservices/axis/trunk/c/tests/auto_build/testcases/client/c/XSD_positiveIntegerClient.c
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/client/c/XSD_positiveIntegerClient.c?rev=405295&r1=405294&r2=405295&view=diff
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/client/c/XSD_positiveIntegerClient.c (original)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/client/c/XSD_positiveIntegerClient.c Mon May 8 20:53:18 2006
@@ -134,9 +134,6 @@
arrayInput.m_Type = XSDC_POSITIVEINTEGER;
arrayResult = asArray(ws, &arrayInput);
-
- if (get_XSD_positiveInteger_Status(ws) == AXISC_FAIL )
- printf ("Failed\n");
if (arrayResult)
{
Modified: webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_nonNegativeIntegerClient.cpp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_nonNegativeIntegerClient.cpp?rev=405295&r1=405294&r2=405295&view=diff
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_nonNegativeIntegerClient.cpp (original)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_nonNegativeIntegerClient.cpp Mon May 8 20:53:18 2006
@@ -22,39 +22,44 @@
int main(int argc, char* argv[])
{
+ XSD_nonNegativeInteger* ws;
+
+ xsd__nonNegativeInteger result;
+ xsd__nonNegativeInteger* nillableInput;
+ xsd__nonNegativeInteger* nillableResult;
+
char endpoint[256];
const char* url="http://localhost:80/axis/XSD_nonNegativeInteger";
if(argc>1)
url = argv[1];
- // bool bSuccess = false;
-
try
{
sprintf(endpoint, "%s", url);
- XSD_nonNegativeInteger* ws = new XSD_nonNegativeInteger(endpoint);
- xsd__nonNegativeInteger result = ws->asNonNillableElement((xsd__nonNegativeInteger) UNSIGNED_LONGLONGVALUE(18446744073709551615));
+ ws = new XSD_nonNegativeInteger(endpoint);
+
+ result = ws->asNonNillableElement((xsd__nonNegativeInteger) UNSIGNED_LONGLONGVALUE(18446744073709551615));
cout << "non-nillable element=" << result << endl;
+
result = ws->asNonNillableElement((xsd__nonNegativeInteger)1);
cout << "non-nillable element=" << result << endl;
+
result = ws->asNonNillableElement((xsd__nonNegativeInteger)0);
cout << "non-nillable element=" << result << endl;
// Test nillable element, with a value
- xsd__nonNegativeInteger* nillableInput = new xsd__nonNegativeInteger();
+ nillableInput = new xsd__nonNegativeInteger();
*(nillableInput) = (xsd__nonNegativeInteger)123456789;
- xsd__nonNegativeInteger* nillableResult = ws->asNillableElement(nillableInput);
+ nillableResult = ws->asNillableElement(nillableInput);
if (nillableResult)
{
cout << "nillable element=" << *(nillableResult) << endl;
delete nillableResult;
}
else
- {
cout << "nillable element=<nil>" << endl;
- }
delete nillableInput;
// Test nillable element, with nil
@@ -65,14 +70,14 @@
delete nillableResult;
}
else
- {
cout << "nil element=<nil>" << endl;
- }
// Test required attribute
RequiredAttributeElement requiredAttributeInput;
+ RequiredAttributeElement* requiredAttributeResult;
+
requiredAttributeInput.setrequiredAttribute(123456789);
- RequiredAttributeElement* requiredAttributeResult = ws->asRequiredAttribute(&requiredAttributeInput);
+ requiredAttributeResult = ws->asRequiredAttribute(&requiredAttributeInput);
cout << "required attribute=" << requiredAttributeResult->getrequiredAttribute() << endl;
delete requiredAttributeResult;
@@ -83,61 +88,54 @@
optionalAttributeInput.setoptionalAttribute(123456789);
OptionalAttributeElement* optionalAttributeResult = ws->asOptionalAttribute(&optionalAttributeInput);
if (optionalAttributeResult->getoptionalAttribute())
- {
cout << "optional attribute, with data=" << optionalAttributeResult->getoptionalAttribute() << endl;
- }
else
- {
cout << "optional attribute, with data=<not present>" << endl;
- }
delete optionalAttributeResult;
// Test optional attribute, not present
optionalAttributeInput.setattribute();
optionalAttributeResult = ws->asOptionalAttribute(&optionalAttributeInput);
if (optionalAttributeResult->getoptionalAttribute())
- {
cout << "optional attribute, not present=" << optionalAttributeResult->getoptionalAttribute() << endl;
- }
else
- {
cout << "optional attribute, not present=<not present>" << endl;
- }
delete optionalAttributeResult;
*/
// Test array
- xsd__nonNegativeInteger_Array arrayInput;
- int arraySize=2;
- xsd__nonNegativeInteger **array = new xsd__nonNegativeInteger*[arraySize];
+#define ARRAY_SIZE 2
+ int i, outputSize=0;
+
+ xsd__nonNegativeInteger_Array arrayInput;
+ xsd__nonNegativeInteger_Array* arrayResult;
+ xsd__nonNegativeInteger *array[ARRAY_SIZE];
+ const xsd__nonNegativeInteger ** output;
- for (int inputIndex=0 ; inputIndex < arraySize ; inputIndex++)
- {
- array[inputIndex] = new xsd__nonNegativeInteger(123456789);;
-
- }
- arrayInput.set(array,arraySize);
- xsd__nonNegativeInteger_Array* arrayResult = ws->asArray(&arrayInput);
- int outputSize=0;
- const xsd__nonNegativeInteger ** output = arrayResult->get(outputSize);
+ for (i=0 ; i < ARRAY_SIZE ; i++)
+ array[i] = new xsd__nonNegativeInteger(123456789);
+
+ arrayInput.set(array,ARRAY_SIZE);
+ arrayResult = ws->asArray(&arrayInput);
+
+ if (arrayResult)
+ output = arrayResult->get(outputSize);
+
cout << "array of " << outputSize << " elements" << endl;
- for (int index = 0; index < outputSize ; index++)
- {
- cout << " element[" << index << "]=" << *((xsd__nonNegativeInteger*)(output[index])) << endl;
-
- }
+ for (i = 0; i < outputSize ; i++)
+ cout << " element[" << i << "]=" << *((xsd__nonNegativeInteger*)(output[i])) << endl;
+
// Clear up input array
- for (int deleteIndex = 0 ; deleteIndex < arraySize ; deleteIndex++ )
- {
- delete array[deleteIndex];
- }
- delete [] array;
+ for (i = 0 ; i < ARRAY_SIZE ; i++ )
+ delete array[i];
delete arrayResult;
// Test complex type
SimpleComplexType complexTypeInput;
+ SimpleComplexType* complexTypeResult;
+
complexTypeInput.setcomplexTypeElement(123456789);
- SimpleComplexType* complexTypeResult = ws->asComplexType(&complexTypeInput);
+ complexTypeResult = ws->asComplexType(&complexTypeInput);
cout << "within complex type=" << complexTypeResult->getcomplexTypeElement() << endl;
delete complexTypeResult;
Modified: webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_nonPositiveIntegerClient.cpp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_nonPositiveIntegerClient.cpp?rev=405295&r1=405294&r2=405295&view=diff
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_nonPositiveIntegerClient.cpp (original)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_nonPositiveIntegerClient.cpp Mon May 8 20:53:18 2006
@@ -22,6 +22,12 @@
int main(int argc, char* argv[])
{
+ XSD_nonPositiveInteger* ws;
+
+ xsd__nonPositiveInteger result;
+ xsd__nonPositiveInteger* nillableInput;
+ xsd__nonPositiveInteger* nillableResult;
+
char endpoint[256];
const char* url="http://localhost:80/axis/XSD_nonPositiveInteger";
@@ -34,11 +40,14 @@
{
// Note: All values are unsigned, but considered to be negative.
sprintf(endpoint, "%s", url);
- XSD_nonPositiveInteger* ws = new XSD_nonPositiveInteger(endpoint);
- xsd__nonPositiveInteger result = ws->asNonNillableElement((xsd__nonPositiveInteger) LONGLONGVALUE(-9223372036854775808));
+ ws = new XSD_nonPositiveInteger(endpoint);
+
+ result = ws->asNonNillableElement((xsd__nonPositiveInteger) LONGLONGVALUE(-9223372036854775808));
cout << "non-nillable element=" << result << endl;
+
result = ws->asNonNillableElement((xsd__nonPositiveInteger)-1);
cout << "non-nillable element=" << result << endl;
+
result = ws->asNonNillableElement((xsd__nonPositiveInteger)0);
cout << "non-nillable element=" << result << endl;
/*
@@ -50,18 +59,16 @@
// Test nillable element, with a value
- xsd__nonPositiveInteger* nillableInput = new xsd__nonPositiveInteger();
+ nillableInput = new xsd__nonPositiveInteger();
*(nillableInput) = (xsd__nonPositiveInteger)-123456789;
- xsd__nonPositiveInteger* nillableResult = ws->asNillableElement(nillableInput);
+ nillableResult = ws->asNillableElement(nillableInput);
if (nillableResult)
{
cout << "nillable element=" << *(nillableResult) << endl;
delete nillableResult;
}
else
- {
cout << "nillable element=<nil>" << endl;
- }
delete nillableInput;
// Test nillable element, with nil
@@ -72,14 +79,14 @@
delete nillableResult;
}
else
- {
cout << "nil element=<nil>" << endl;
- }
// Test required attribute
RequiredAttributeElement requiredAttributeInput;
+ RequiredAttributeElement* requiredAttributeResult;
+
requiredAttributeInput.setrequiredAttribute(-123456789);
- RequiredAttributeElement* requiredAttributeResult = ws->asRequiredAttribute(&requiredAttributeInput);
+ requiredAttributeResult = ws->asRequiredAttribute(&requiredAttributeInput);
cout << "required attribute=" << requiredAttributeResult->getrequiredAttribute() << endl;
delete requiredAttributeResult;
@@ -90,62 +97,56 @@
optionalAttributeInput.setoptionalAttribute(-123456789);
OptionalAttributeElement* optionalAttributeResult = ws->asOptionalAttribute(&optionalAttributeInput);
if (optionalAttributeResult->getoptionalAttribute())
- {
cout << "optional attribute, with data=" << optionalAttributeResult->getoptionalAttribute() << endl;
- }
else
- {
cout << "optional attribute, with data=<not present>" << endl;
- }
delete optionalAttributeResult;
// Test optional attribute, not present
optionalAttributeInput.setattribute();
optionalAttributeResult = ws->asOptionalAttribute(&optionalAttributeInput);
if (optionalAttributeResult->getoptionalAttribute())
- {
cout << "optional attribute, not present=" << optionalAttributeResult->getoptionalAttribute() << endl;
- }
else
- {
cout << "optional attribute, not present=<not present>" << endl;
- }
delete optionalAttributeResult;
*/
// Test array
+#define ARRAY_SIZE 2
+ int i, outputSize=0;
+
xsd__nonPositiveInteger_Array arrayInput;
- int arraySize=2;
- xsd__nonPositiveInteger ** array = new xsd__nonPositiveInteger*[arraySize];
+ xsd__nonPositiveInteger_Array* arrayResult;
+ xsd__nonPositiveInteger *array[ARRAY_SIZE];
+ const xsd__nonPositiveInteger ** output;
- for (int inputIndex=0 ; inputIndex < arraySize ; inputIndex++)
- {
- array[inputIndex] = new xsd__nonPositiveInteger(-123456789);
+ for (i=0 ; i < ARRAY_SIZE ; i++)
+ array[i] = new xsd__nonPositiveInteger(-123456789);
+
+ arrayInput.set(array,ARRAY_SIZE);
+
+ arrayResult = ws->asArray(&arrayInput);
+
+ if (arrayResult)
+ output = arrayResult->get(outputSize);
- }
- arrayInput.set(array,arraySize);
- xsd__nonPositiveInteger_Array* arrayResult = ws->asArray(&arrayInput);
- int outputSize=0;
- const xsd__nonPositiveInteger ** output = arrayResult->get(outputSize);
cout << "array of " << outputSize << " elements" << endl;
- for (int index = 0; index < outputSize ; index++)
- {
- cout << " element[" << index << "]=" << *((xsd__nonPositiveInteger*)(output[index])) << endl;
-
- }
+ for (i = 0; i < outputSize ; i++)
+ cout << " element[" << i << "]=" << *((xsd__nonPositiveInteger*)(output[i])) << endl;
+
// Clear up input array
- for (int deleteIndex = 0 ; deleteIndex < arraySize ; deleteIndex++ )
- {
- delete array[deleteIndex];
- }
- delete [] array;
+ for (i = 0 ; i < ARRAY_SIZE ; i++ )
+ delete array[i];
delete arrayResult;
// Test complex type
SimpleComplexType complexTypeInput;
+ SimpleComplexType* complexTypeResult;
+
complexTypeInput.setcomplexTypeElement(-123456789);
- SimpleComplexType* complexTypeResult = ws->asComplexType(&complexTypeInput);
+ complexTypeResult = ws->asComplexType(&complexTypeInput);
cout << "within complex type=" << complexTypeResult->getcomplexTypeElement() << endl;
delete complexTypeResult;
Modified: webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_normalizedStringClient.cpp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_normalizedStringClient.cpp?rev=405295&r1=405294&r2=405295&view=diff
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_normalizedStringClient.cpp (original)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_normalizedStringClient.cpp Mon May 8 20:53:18 2006
@@ -22,6 +22,16 @@
int main(int argc, char* argv[])
{
+ XSD_normalizedString* ws;
+
+ xsd__normalizedString input;
+ xsd__normalizedString result;
+
+ char simplenormalizedString[25] = "A simple test message!";
+ char emptynormalizedString[1] = "";
+ char reservedCharactersnormalizedString[] = "<>&\"\'";
+ char whitespacenormalizedString[] = " \t\r\nsome text \t\r\nmore text \t\r\n";
+
char endpoint[256];
const char* url="http://localhost:80/axis/XSD_normalizedString";
@@ -31,200 +41,148 @@
try
{
sprintf(endpoint, "%s", url);
- XSD_normalizedString* ws = new XSD_normalizedString(endpoint);
+ ws = new XSD_normalizedString(endpoint);
- char emptynormalizedString[1] = "";
- xsd__normalizedString emptyInput = new char[1];
- strcpy (emptyInput, emptynormalizedString);
- char simplenormalizedString[25] = "A simple test message!";
- xsd__normalizedString input = new char[25];
+ input = new char[25];
strcpy (input, simplenormalizedString);
// Test non-nillable element
- xsd__normalizedString result = ws->asNonNillableElement(input);
+ result = ws->asNonNillableElement(input);
if (result)
{
if (*result)
- {
cout << "non-nillable element=" << result << endl;
- }
else
- {
cout << "non-nillable element=<empty>" << endl;
- }
+ delete [] result;
}
else
- {
cout << "non-nillable element=<nil>" << endl;
- }
delete [] input;
// Test empty non-nillable element
- result = ws->asNonNillableElement(emptyInput);
+ input = new char[1];
+ strcpy (input, emptynormalizedString);
+ result = ws->asNonNillableElement(input);
if (result)
{
if (*result)
- {
cout << "empty non-nillable element=" << result << endl;
- }
else
- {
cout << "empty non-nillable element=<empty>" << endl;
- }
+ delete [] result;
}
else
- {
cout << "empty non-nillable element=<nil>" << endl;
- }
- delete [] emptyInput;
+ delete [] input;
// Test non-nillable element with XML reserved characters
- char reservedCharactersnormalizedString[] = "<>&\"\'";
- xsd__normalizedString reservedCharactersInput = reservedCharactersnormalizedString;
- result = ws->asNonNillableElement(reservedCharactersInput);
+ input = reservedCharactersnormalizedString;
+ result = ws->asNonNillableElement(input);
if (result)
{
if (*result)
- {
cout << "non-nillable element with XML reserved characters=" << result << endl;
- }
else
- {
cout << "non-nillable element with XML reserved characters=<empty>" << endl;
- }
+ delete [] result;
}
else
- {
cout << "non-nillable element with XML reserved characters=<nil>" << endl;
- }
// Test non-nillable element with XML reserved characters
- char whitespacenormalizedString[] = " \t\r\nsome text \t\r\nmore text \t\r\n";
- xsd__normalizedString whitespaceInput = whitespacenormalizedString;
- result = ws->asNonNillableElement(whitespaceInput);
+ input = whitespacenormalizedString;
+ result = ws->asNonNillableElement(input);
if (result)
{
if (*result)
- {
cout << "non-nillable element with whitespace characters=\"" << result << "\"" << endl;
- }
else
- {
cout << "non-nillable element with whitespace characters=<empty>" << endl;
- }
+ delete [] result;
}
else
- {
cout << "non-nillable element with whitespace characters=<nil>" << endl;
- }
// Test nillable element, with a value
input = new char[25];
strcpy (input, simplenormalizedString);
- xsd__normalizedString nillableResult = ws->asNillableElement(input);
- if (nillableResult)
+ result = ws->asNillableElement(input);
+ if (result)
{
- if (*nillableResult)
- {
- cout << "nillable element=" << nillableResult << endl;
- }
+ if (*result)
+ cout << "nillable element=" << result << endl;
else
- {
cout << "nillable element=<empty>" << endl;
- }
- delete nillableResult;
+ delete result;
}
else
- {
cout << "nillable element=<nil>" << endl;
- }
delete [] input;
// Test empty nillable element
- emptyInput = new char[1];
- strcpy (emptyInput, emptynormalizedString);
- nillableResult = ws->asNillableElement(emptyInput);
- if (nillableResult)
+ input = new char[1];
+ strcpy (input, emptynormalizedString);
+ result = ws->asNillableElement(input);
+ if (result)
{
- if (*nillableResult)
- {
- cout << "empty nillable element=" << nillableResult << endl;
- }
+ if (*result)
+ cout << "empty nillable element=" << result << endl;
else
- {
cout << "empty nillable element=<empty>" << endl;
- }
- delete nillableResult;
+ delete result;
}
else
- {
cout << "empty nillable element=<nil>" << endl;
- }
- delete [] emptyInput;
+ delete [] input;
// Test nillable element, with nil
- nillableResult = ws->asNillableElement(NULL);
- if (nillableResult)
+ result = ws->asNillableElement(NULL);
+ if (result)
{
- if (*nillableResult)
- {
- cout << "nil element=" << nillableResult << endl;
- }
+ if (*result)
+ cout << "nil element=" << result << endl;
else
- {
cout << "nil element=<empty>" << endl;
- }
- delete nillableResult;
+ delete result;
}
else
- {
cout << "nil element=<nil>" << endl;
- }
// Test required attribute
input = new char[25];
strcpy (input, simplenormalizedString);
RequiredAttributeElement requiredAttributeInput;
+ RequiredAttributeElement* requiredAttributeResult;
+
requiredAttributeInput.setrequiredAttribute(input);
- RequiredAttributeElement* requiredAttributeResult = ws->asRequiredAttribute(&requiredAttributeInput);
+ requiredAttributeResult = ws->asRequiredAttribute(&requiredAttributeInput);
if (requiredAttributeResult->getrequiredAttribute())
{
if (*(requiredAttributeResult->getrequiredAttribute()))
- {
cout << "required attribute=" << requiredAttributeResult->getrequiredAttribute() << endl;
- }
else
- {
cout << "required attribute=<empty>" << endl;
- }
}
else
- {
cout << "required attribute=<nil>" << endl;
- }
delete requiredAttributeResult;
// Test empty required attribute
- emptyInput = new char[1];
- strcpy (emptyInput, emptynormalizedString);
- requiredAttributeInput;
- requiredAttributeInput.setrequiredAttribute(emptyInput);
+ input = new char[1];
+ strcpy (input, emptynormalizedString);
+
+ requiredAttributeInput.setrequiredAttribute(input);
requiredAttributeResult = ws->asRequiredAttribute(&requiredAttributeInput);
if (requiredAttributeResult->getrequiredAttribute())
{
if (*(requiredAttributeResult->getrequiredAttribute()))
- {
cout << "empty required attribute=" << requiredAttributeResult->getrequiredAttribute() << endl;
- }
else
- {
cout << "empty required attribute=<empty>" << endl;
- }
}
else
- {
cout << "empty required attribute=<nil>" << endl;
- }
delete requiredAttributeResult;
/* Optional Attributes currently unsupported by WSDL2Ws
@@ -238,42 +196,30 @@
if (optionalAttributeResult->getoptionalAttribute())
{
if (*(optionalAttributeResult->getoptionalAttribute()))
- {
cout << "optional attribute, with data=" << optionalAttributeResult->getoptionalAttribute() << endl;
- }
else
- {
cout << "optional attribute, with data=<empty>" << endl;
- }
}
else
- {
cout << "optional attribute, with data=<not present>" << endl;
- }
delete [] input;
delete optionalAttributeResult;
// Test empty optional attribute
- emptyInput = new char[1];
- strcpy (emptyInput, emptynormalizedString);
- optionalAttributeInput.setoptionalAttribute(emptyInput);
+ input = new char[1];
+ strcpy (input, emptynormalizedString);
+ optionalAttributeInput.setoptionalAttribute(input);
optionalAttributeResult = ws->asOptionalAttribute(&optionalAttributeInput);
if (optionalAttributeResult->getoptionalAttribute())
{
if (*(optionalAttributeResult->getoptionalAttribute()))
- {
cout << "empty optional attribute=" << optionalAttributeResult->getoptionalAttribute() << endl;
- }
else
- {
cout << "empty optional attribute=<empty>" << endl;
- }
}
else
- {
cout << "empty optional attribute=<not present>" << endl;
- }
- delete [] emptyInput;
+ delete [] input;
delete optionalAttributeResult;
// Test optional attribute, not present
@@ -282,62 +228,58 @@
if (optionalAttributeResult->getoptionalAttribute())
{
if (*(optionalAttributeResult->getoptionalAttribute()))
- {
cout << "optional attribute, not present=" << optionalAttributeResult->getoptionalAttribute() << endl;
- }
else
- {
cout << "optional attribute, not present=<empty>" << endl;
- }
}
else
- {
cout << "optional attribute, not present=<not present>" << endl;
- }
delete optionalAttributeResult;
*/
// Test array
+#define ARRAY_SIZE 2
+ int i, outputSize=0;
+
xsd__normalizedString_Array arrayInput;
- int arraySize=2;
- xsd__normalizedString * array = new xsd__normalizedString[arraySize];
- for (int inputIndex=0 ; inputIndex < arraySize ; inputIndex++)
- {
- array[inputIndex] = new char[25];
- strcpy (array[inputIndex], simplenormalizedString);
- }
- arrayInput.set(array,arraySize);
- xsd__normalizedString_Array* arrayResult = ws->asArray(&arrayInput);
- int outputSize=0;
- const xsd__normalizedString * output = arrayResult->get(outputSize);
+ xsd__normalizedString_Array* arrayResult;
+ xsd__normalizedString array[ARRAY_SIZE];
+ const xsd__normalizedString * output;
+
+ for (i=0 ; i < ARRAY_SIZE ; i++)
+ {
+ array[i] = new char[25];
+ strcpy (array[i], simplenormalizedString);
+ }
+ arrayInput.set(array,ARRAY_SIZE);
+
+ arrayResult = ws->asArray(&arrayInput);
+
+ if (arrayResult)
+ output = arrayResult->get(outputSize);
cout << "array of " << outputSize << " elements" << endl;
- for (int index = 0; index < outputSize ; index++)
+ for (i = 0; i < outputSize ; i++)
{
if (output != NULL)
{
- if (output[index]!=NULL)
- {
- cout << " element[" << index << "]=" << output[index] << endl;
- }
+ if (output[i]!=NULL)
+ cout << " element[" << i << "]=" << output[i] << endl;
else
- {
- cout << " element[" << index << "]=<empty>" << endl;
- }
-
+ cout << " element[" << i << "]=<empty>" << endl;
}
else
- {
- cout << " element[" << index << "]=<nil>" << endl;
- }
+ cout << " element[" << i << "]=<nil>" << endl;
}
+
// Clear up input array
- for (int deleteIndex = 0 ; deleteIndex < arraySize ; deleteIndex++ )
- {
- delete [] array[deleteIndex];
- }
- delete [] array;
+ for (i = 0 ; i < ARRAY_SIZE ; i++ )
+ delete [] array[i];
delete arrayResult;
+
+
+
+
// Test complex type
input = new char[25];
strcpy (input, simplenormalizedString);
@@ -347,18 +289,12 @@
if (complexTypeResult->getcomplexTypeElement())
{
if (*(complexTypeResult->getcomplexTypeElement()))
- {
cout << "within complex type=" << complexTypeResult->getcomplexTypeElement() << endl;
- }
else
- {
cout << "within complex type=<empty>" << endl;
- }
}
else
- {
cout << "within complex type=<nil>" << endl;
- }
delete complexTypeResult;
// Tests now complete
Added: webservices/axis/trunk/c/tests/auto_build/testcases/tests/XSD_nonNegativeIntegerC.xml
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/tests/XSD_nonNegativeIntegerC.xml?rev=405295&view=auto
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/tests/XSD_nonNegativeIntegerC.xml (added)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/tests/XSD_nonNegativeIntegerC.xml Mon May 8 20:53:18 2006
@@ -0,0 +1,17 @@
+<test>
+ <name>XSD_nonNegativeIntegerC</name>
+ <description>Test serialization and deserialization of the XSD built-in simple type nonNegativeInteger</description>
+ <clientLang>c</clientLang>
+ <clientCode>XSD_nonNegativeIntegerClient.c</clientCode>
+ <wsdl>XSD_nonNegativeInteger.wsdl</wsdl>
+ <expected>
+ <output>
+ XSD_nonNegativeInteger.expected
+ </output>
+ <serverResponse>
+ XSD_nonNegativeInteger_ServerResponse.expected
+ </serverResponse>
+ </expected>
+ <endpoint>http://localhost:80/axis/XSD_nonNegativeInteger</endpoint>
+</test>
+
Added: webservices/axis/trunk/c/tests/auto_build/testcases/tests/XSD_nonPositiveIntegerC.xml
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/tests/XSD_nonPositiveIntegerC.xml?rev=405295&view=auto
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/tests/XSD_nonPositiveIntegerC.xml (added)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/tests/XSD_nonPositiveIntegerC.xml Mon May 8 20:53:18 2006
@@ -0,0 +1,17 @@
+<test>
+ <name>XSD_nonPositiveIntegerC</name>
+ <description>Test serialization and deserialization of the XSD built-in simple type nonPositiveInteger</description>
+ <clientLang>c</clientLang>
+ <clientCode>XSD_nonPositiveIntegerClient.c</clientCode>
+ <wsdl>XSD_nonPositiveInteger.wsdl</wsdl>
+ <expected>
+ <output>
+ XSD_nonPositiveInteger.expected
+ </output>
+ <serverResponse>
+ XSD_nonPositiveInteger_ServerResponse.expected
+ </serverResponse>
+ </expected>
+ <endpoint>http://localhost:80/axis/XSD_nonPositiveInteger</endpoint>
+</test>
+
Added: webservices/axis/trunk/c/tests/auto_build/testcases/tests/XSD_normalizedStringC.xml
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/tests/XSD_normalizedStringC.xml?rev=405295&view=auto
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/tests/XSD_normalizedStringC.xml (added)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/tests/XSD_normalizedStringC.xml Mon May 8 20:53:18 2006
@@ -0,0 +1,17 @@
+<test>
+ <name>XSD_normalizedStringC</name>
+ <description>Test serialization and deserialization of the XSD built-in simple type normalizedString</description>
+ <clientLang>c</clientLang>
+ <clientCode>XSD_normalizedStringClient.c</clientCode>
+ <wsdl>XSD_normalizedString.wsdl</wsdl>
+ <expected>
+ <output>
+ XSD_normalizedString.expected
+ </output>
+ <serverResponse>
+ XSD_normalizedString_ServerResponse.expected
+ </serverResponse>
+ </expected>
+ <endpoint>http://localhost:80/axis/XSD_normalizedString</endpoint>
+</test>
+