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 04:18:04 UTC
svn commit: r405275 - in
/webservices/axis/trunk/c/tests/auto_build/testcases: client/c/ tests/
Author: nadiramra
Date: Mon May 8 19:18:01 2006
New Revision: 405275
URL: http://svn.apache.org/viewcvs?rev=405275&view=rev
Log:
C support fixes/enhancements. Testcases for C bindings.
Added:
webservices/axis/trunk/c/tests/auto_build/testcases/client/c/XSD_tokenClient.c
webservices/axis/trunk/c/tests/auto_build/testcases/client/c/XSD_unsignedByteClient.c
webservices/axis/trunk/c/tests/auto_build/testcases/client/c/XSD_unsignedIntClient.c
webservices/axis/trunk/c/tests/auto_build/testcases/client/c/XSD_unsignedLongClient.c
webservices/axis/trunk/c/tests/auto_build/testcases/client/c/XSD_unsignedShortClient.c
webservices/axis/trunk/c/tests/auto_build/testcases/tests/XSD_QNameC.xml
webservices/axis/trunk/c/tests/auto_build/testcases/tests/XSD_positiveIntegerC.xml
webservices/axis/trunk/c/tests/auto_build/testcases/tests/XSD_shortC.xml
webservices/axis/trunk/c/tests/auto_build/testcases/tests/XSD_stringC.xml
webservices/axis/trunk/c/tests/auto_build/testcases/tests/XSD_timeC.xml
webservices/axis/trunk/c/tests/auto_build/testcases/tests/XSD_tokenC.xml
webservices/axis/trunk/c/tests/auto_build/testcases/tests/XSD_unsignedByteC.xml
webservices/axis/trunk/c/tests/auto_build/testcases/tests/XSD_unsignedIntC.xml
webservices/axis/trunk/c/tests/auto_build/testcases/tests/XSD_unsignedLongC.xml
webservices/axis/trunk/c/tests/auto_build/testcases/tests/XSD_unsignedShortC.xml
Added: webservices/axis/trunk/c/tests/auto_build/testcases/client/c/XSD_tokenClient.c
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/client/c/XSD_tokenClient.c?rev=405275&view=auto
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/client/c/XSD_tokenClient.c (added)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/client/c/XSD_tokenClient.c Mon May 8 19:18:01 2006
@@ -0,0 +1,269 @@
+// 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_token.h"
+
+
+
+int main(int argc, char* argv[])
+{
+ AXISCHANDLE ws ;
+
+ xsdc__token input;
+ xsdc__token result;
+
+ char emptytoken[1] = "";
+ char simpletoken[25] = "A simple test message!";
+ char reservedCharacterstoken[] = "<>&\"\'";
+ char whitespacetoken[] = " \t\r\nsome text \t\r\nmore text \t\r\n";
+
+ char endpoint[256];
+ const char* url="http://localhost:80/axis/XSD_token";
+
+ if(argc>1)
+ url = argv[1];
+
+ axiscAxisRegisterExceptionHandler(exceptionHandler);
+
+ sprintf(endpoint, "%s", url);
+ ws = get_XSD_token_stub(endpoint);
+
+ // Test non-nillable element
+ result = asNonNillableElement(ws, simpletoken);
+ if (result)
+ {
+ if (*result)
+ printf("non-nillable element=%s\n" , result );
+ else
+ printf("non-nillable element=<empty>\n" );
+ axiscAxisDelete(result, XSDC_TOKEN);
+ }
+ else
+ printf("non-nillable element=<nil>\n" );
+
+ // Test non-nillable element with XML reserved characters
+ result = asNonNillableElement(ws, reservedCharacterstoken);
+ 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_TOKEN);
+ }
+ else
+ printf("non-nillable element with XML reserved characters=<nil>\n" );
+
+ // Test non-nillable element with XML reserved characters
+ result = asNonNillableElement(ws, whitespacetoken);
+ 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_TOKEN);
+ }
+ else
+ printf("non-nillable element with whitespace characters=<nil>\n" );
+
+ // Test nillable element, with a value
+ result = asNillableElement(ws, simpletoken);
+ if (result)
+ {
+ if (*result)
+ printf("nillable element=%s\n" , result );
+ else
+ printf("nillable element=<empty>\n" );
+ axiscAxisDelete(result, XSDC_TOKEN);
+ }
+ else
+ printf("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_TOKEN);
+ }
+ else
+ printf("nil element=<nil>\n" );
+
+ // Test required attribute
+ {
+ RequiredAttributeElement requiredAttributeInput;
+ RequiredAttributeElement* requiredAttributeResult;
+
+ requiredAttributeInput.requiredAttribute = simpletoken;
+ 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);
+ }
+
+
+/* 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, simpletoken);
+ OptionalAttributeElement optionalAttributeInput;
+ optionalAttributeInput.setoptionalAttribute(input);
+ OptionalAttributeElement* optionalAttributeResult = ws->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, emptytoken);
+ optionalAttributeInput.setoptionalAttribute(input);
+ optionalAttributeResult = ws->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 = ws->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__token_Array arrayInput;
+ xsdc__token_Array* arrayResult;
+ xsdc__token array[ARRAY_SIZE];
+ xsdc__token * output;
+
+ for (i=0 ; i < ARRAY_SIZE ; i++)
+ array[i]= simpletoken;
+
+ arrayInput.m_Array = array;
+ arrayInput.m_Size = ARRAY_SIZE;
+ arrayInput.m_Type = XSDC_TOKEN;
+
+ 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 );
+ }
+
+ // Clean up
+ axiscAxisDelete(arrayResult, XSDC_ARRAY);
+ }
+
+
+
+
+
+ // Test complex type
+ {
+ SimpleComplexType complexTypeInput;
+ SimpleComplexType* complexTypeResult;
+
+ complexTypeInput.complexTypeElement = simpletoken;
+ 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_token_stub(ws);
+
+ printf("---------------------- TEST COMPLETE -----------------------------\n");
+
+ return 0;
+}
Added: webservices/axis/trunk/c/tests/auto_build/testcases/client/c/XSD_unsignedByteClient.c
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/client/c/XSD_unsignedByteClient.c?rev=405275&view=auto
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/client/c/XSD_unsignedByteClient.c (added)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/client/c/XSD_unsignedByteClient.c Mon May 8 19:18:01 2006
@@ -0,0 +1,158 @@
+// 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_unsignedByte.h"
+
+
+int main(int argc, char* argv[])
+{
+ AXISCHANDLE ws;
+
+ xsdc__unsignedByte result;
+ xsdc__unsignedByte input;
+ xsdc__unsignedByte* nillableResult;
+
+ char endpoint[256];
+ const char* url="http://localhost:80/axis/XSD_unsignedByte";
+
+ axiscAxisRegisterExceptionHandler(exceptionHandler);
+
+ if(argc>1)
+ url = argv[1];
+
+ sprintf(endpoint, "%s", url);
+ ws = get_XSD_unsignedByte_stub(endpoint);
+
+ result = asNonNillableElement(ws, (xsdc__unsignedByte)255);
+ printf("non-nillable element=%d\n" , (int) result );
+
+ result = asNonNillableElement(ws, (xsdc__unsignedByte)1);
+ printf("non-nillable element=%d\n" , (int) result );
+
+ result = asNonNillableElement(ws, (xsdc__unsignedByte)0);
+ printf("non-nillable element=%d\n" , (int) result );
+
+ // Test nillable element, with a value
+ input = (xsdc__unsignedByte)123;
+ nillableResult = asNillableElement(ws, &input);
+ if (nillableResult)
+ {
+ printf("nillable element=%d\n" , (int) *(nillableResult) );
+ axiscAxisDelete(nillableResult, XSDC_UNSIGNEDBYTE);
+ }
+ else
+ printf("nillable element=<nil>\n" );
+
+ // Test nillable element, with nil
+ nillableResult = asNillableElement(ws, NULL);
+ if (nillableResult)
+ {
+ printf("nil element=%d\n" , (int) *(nillableResult) );
+ axiscAxisDelete(nillableResult, XSDC_UNSIGNEDBYTE);
+ }
+ else
+ printf("nil element=<nil>\n" );
+
+ // Test required attribute
+ {
+ RequiredAttributeElement requiredAttributeInput;
+ RequiredAttributeElement* requiredAttributeResult;
+
+ requiredAttributeInput.requiredAttribute = 123;
+ requiredAttributeResult = asRequiredAttribute(ws, &requiredAttributeInput);
+ printf("required attribute=%d\n" , (int) 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(123);
+ OptionalAttributeElement* optionalAttributeResult = ws->asOptionalAttribute(&optionalAttributeInput);
+ if (optionalAttributeResult->getoptionalAttribute())
+ printf("optional attribute, with data=" , (int) optionalAttributeResult->getoptionalAttribute() );
+ else
+ printf("optional attribute, with data=<not present>\n" );
+ delete optionalAttributeResult;
+
+ // Test optional attribute, not present
+ optionalAttributeInput.setattribute();
+ optionalAttributeResult = ws->asOptionalAttribute(&optionalAttributeInput);
+ if (optionalAttributeResult->getoptionalAttribute())
+ printf("optional attribute, not present=" , (int) optionalAttributeResult->getoptionalAttribute() );
+ else
+ printf("optional attribute, not present=<not present>\n" );
+ delete optionalAttributeResult;
+*/
+
+ // Test array
+ {
+#define ARRAY_SIZE 2
+ int i, outputSize=0;
+
+ xsdc__unsignedByte_Array arrayInput;
+ xsdc__unsignedByte_Array* arrayResult;
+ xsdc__unsignedByte * array[ARRAY_SIZE];
+ xsdc__unsignedByte ** output;
+
+ input = 123;
+ for (i=0 ; i < ARRAY_SIZE ; i++)
+ array[i] = &input;
+
+ arrayInput.m_Array = array;
+ arrayInput.m_Size = ARRAY_SIZE;
+ arrayInput.m_Type = XSDC_UNSIGNEDBYTE;
+
+ 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]=%d\n", i , (int) *((xsdc__unsignedByte*)(output[i])) );
+
+ axiscAxisDelete(arrayResult, XSDC_ARRAY);
+ }
+
+
+
+
+ // Test complex type
+ {
+ SimpleComplexType complexTypeInput;
+ SimpleComplexType* complexTypeResult;
+
+ complexTypeInput.complexTypeElement = 123;
+ complexTypeResult = asComplexType(ws, &complexTypeInput);
+ printf("within complex type=%d\n" , (int) complexTypeResult->complexTypeElement );
+ Axis_Delete_SimpleComplexType(complexTypeResult, 0);
+ }
+
+ // Tests now complete
+ destroy_XSD_unsignedByte_stub(ws);
+
+ printf("---------------------- TEST COMPLETE -----------------------------\n");
+
+ return 0;
+}
Added: webservices/axis/trunk/c/tests/auto_build/testcases/client/c/XSD_unsignedIntClient.c
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/client/c/XSD_unsignedIntClient.c?rev=405275&view=auto
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/client/c/XSD_unsignedIntClient.c (added)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/client/c/XSD_unsignedIntClient.c Mon May 8 19:18:01 2006
@@ -0,0 +1,154 @@
+// 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_unsignedInt.h"
+
+int main(int argc, char* argv[])
+{
+ AXISCHANDLE ws;
+
+ xsdc__unsignedInt result;
+ xsdc__unsignedInt input;
+ xsdc__unsignedInt* nillableResult;
+
+ char endpoint[256];
+ const char* url="http://localhost:80/axis/XSD_unsignedInt";
+
+ axiscAxisRegisterExceptionHandler(exceptionHandler);
+
+ if(argc>1)
+ url = argv[1];
+
+ sprintf(endpoint, "%s", url);
+ ws = get_XSD_unsignedInt_stub(endpoint);
+
+ result = asNonNillableElement(ws, (xsdc__unsignedInt)4294967295);
+ printf("non-nillable element=%u\n" , result );
+
+ result = asNonNillableElement(ws, (xsdc__unsignedInt)1);
+ printf("non-nillable element=%u\n" , result );
+
+ result = asNonNillableElement(ws, (xsdc__unsignedInt)0);
+ printf("non-nillable element=%u\n" , result );
+
+ // Test nillable element, with a value
+ input = (xsdc__unsignedInt)123456789;
+ nillableResult = asNillableElement(ws, &input);
+ if (nillableResult)
+ {
+ printf("nillable element=%u\n" , *(nillableResult) );
+ axiscAxisDelete(nillableResult, XSDC_UNSIGNEDINT);
+ }
+ else
+ printf("nillable element=<nil>\n" );
+
+ // Test nillable element, with nil
+ nillableResult = asNillableElement(ws, NULL);
+ if (nillableResult)
+ {
+ printf("nil element=%u\n" , *(nillableResult) );
+ axiscAxisDelete(nillableResult, XSDC_UNSIGNEDINT);
+ }
+ else
+ printf("nil element=<nil>\n" );
+
+ // Test required attribute
+ {
+ RequiredAttributeElement requiredAttributeInput;
+ RequiredAttributeElement* requiredAttributeResult;
+
+ requiredAttributeInput.requiredAttribute = 123456789;
+ requiredAttributeResult = asRequiredAttribute(ws, &requiredAttributeInput);
+ printf("required attribute=%u\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__unsignedInt_Array arrayInput;
+ xsdc__unsignedInt_Array* arrayResult;
+ xsdc__unsignedInt * array[ARRAY_SIZE];
+ xsdc__unsignedInt ** 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_UNSIGNEDINT;
+
+ 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]=%u\n" , i, *((xsdc__unsignedInt*)(output[i])) );
+
+ axiscAxisDelete(arrayResult, XSDC_ARRAY);
+ }
+
+
+ // Test complex type
+ {
+ SimpleComplexType complexTypeInput;
+ SimpleComplexType* complexTypeResult;
+
+ complexTypeInput.complexTypeElement = 123456789;
+ complexTypeResult = asComplexType(ws, &complexTypeInput);
+ printf("within complex type=%u\n" , complexTypeResult->complexTypeElement );
+ Axis_Delete_SimpleComplexType(complexTypeResult, 0);
+ }
+
+ // Tests now complete
+ destroy_XSD_unsignedInt_stub(ws);
+
+ printf("---------------------- TEST COMPLETE -----------------------------\n");
+
+ return 0;
+}
Added: webservices/axis/trunk/c/tests/auto_build/testcases/client/c/XSD_unsignedLongClient.c
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/client/c/XSD_unsignedLongClient.c?rev=405275&view=auto
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/client/c/XSD_unsignedLongClient.c (added)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/client/c/XSD_unsignedLongClient.c Mon May 8 19:18:01 2006
@@ -0,0 +1,159 @@
+// 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_unsignedLong.h"
+
+
+int main(int argc, char* argv[])
+{
+ AXISCHANDLE ws;
+
+ xsdc__unsignedLong result;
+ xsdc__unsignedLong input;
+ xsdc__unsignedLong* nillableResult;
+
+ char endpoint[256];
+ const char* url="http://localhost:80/axis/XSD_unsignedLong";
+
+ axiscAxisRegisterExceptionHandler(exceptionHandler);
+
+ if(argc>1)
+ url = argv[1];
+
+
+ sprintf(endpoint, "%s", url);
+ ws = get_XSD_unsignedLong_stub(endpoint);
+
+ result = asNonNillableElement(ws, (xsdc__unsignedLong) UNSIGNED_LONGLONGVALUE(18446744073709551615));
+ printf("non-nillable element=%llu\n" , result );
+
+ result = asNonNillableElement(ws, (xsdc__unsignedLong)1);
+ printf("non-nillable element=%llu\n" , result );
+
+ result = asNonNillableElement(ws, (xsdc__unsignedLong)0);
+ printf("non-nillable element=%llu\n" , result );
+
+
+ // Test nillable element, with a value
+ input = (xsdc__unsignedLong)123456789;
+ nillableResult = asNillableElement(ws, &input);
+ if (nillableResult)
+ {
+ printf("nillable element=%llu\n" , *(nillableResult) );
+ axiscAxisDelete(nillableResult, XSDC_UNSIGNEDLONG);
+ }
+ 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_UNSIGNEDLONG);
+ }
+ 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__unsignedLong_Array arrayInput;
+ xsdc__unsignedLong_Array* arrayResult;
+ xsdc__unsignedLong * array[ARRAY_SIZE];
+ xsdc__unsignedLong ** 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_UNSIGNEDLONG;
+
+ 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__unsignedLong*)(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_unsignedLong_stub(ws);
+
+
+ printf( "---------------------- TEST COMPLETE -----------------------------\n");
+
+ return 0;
+}
Added: webservices/axis/trunk/c/tests/auto_build/testcases/client/c/XSD_unsignedShortClient.c
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/client/c/XSD_unsignedShortClient.c?rev=405275&view=auto
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/client/c/XSD_unsignedShortClient.c (added)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/client/c/XSD_unsignedShortClient.c Mon May 8 19:18:01 2006
@@ -0,0 +1,156 @@
+// 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_unsignedShort.h"
+
+int main(int argc, char* argv[])
+{
+ AXISCHANDLE ws;
+
+ xsdc__unsignedShort result;
+ xsdc__unsignedShort input;
+ xsdc__unsignedShort* nillableResult;
+
+
+ char endpoint[256];
+ const char* url="http://localhost:80/axis/XSD_unsignedShort";
+
+ axiscAxisRegisterExceptionHandler(exceptionHandler);
+
+ if(argc>1)
+ url = argv[1];
+
+ sprintf(endpoint, "%s", url);
+ ws = get_XSD_unsignedShort_stub(endpoint);
+
+ result = asNonNillableElement(ws, (xsdc__unsignedShort)65535);
+ printf("non-nillable element=%hu\n" , result );
+
+ result = asNonNillableElement(ws, (xsdc__unsignedShort)1);
+ printf("non-nillable element=%hu\n" , result );
+
+ result = asNonNillableElement(ws, (xsdc__unsignedShort)0);
+ printf("non-nillable element=%hu\n" , result );
+
+
+ // Test nillable element, with a value
+ input = (xsdc__unsignedShort)12345;
+ nillableResult = asNillableElement(ws, &input);
+ if (nillableResult)
+ {
+ printf("nillable element=%hu\n" , *(nillableResult) );
+ axiscAxisDelete(nillableResult, XSDC_UNSIGNEDSHORT);
+ }
+ else
+ printf("nillable element=<nil>\n" );
+
+ // Test nillable element, with nil
+ nillableResult = asNillableElement(ws, NULL);
+ if (nillableResult)
+ {
+ printf("nil element=%hu\n" , *(nillableResult) );
+ axiscAxisDelete(nillableResult, XSDC_UNSIGNEDSHORT);
+ }
+ else
+ printf("nil element=<nil>\n" );
+
+ // Test required attribute
+ {
+ RequiredAttributeElement requiredAttributeInput;
+ RequiredAttributeElement* requiredAttributeResult;
+
+ requiredAttributeInput.requiredAttribute = 12345;
+ requiredAttributeResult = asRequiredAttribute(ws, &requiredAttributeInput);
+ printf("required attribute=%hu\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(12345);
+ 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__unsignedShort_Array arrayInput;
+ xsdc__unsignedShort_Array* arrayResult;
+ xsdc__unsignedShort * array[ARRAY_SIZE];
+ xsdc__unsignedShort ** output;
+
+ input = 12345;
+ for (i=0 ; i < ARRAY_SIZE ; i++)
+ array[i] = &input;
+
+ arrayInput.m_Array = array;
+ arrayInput.m_Size = ARRAY_SIZE;
+ arrayInput.m_Type = XSDC_UNSIGNEDSHORT;
+
+ 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]=%hu\n" , i, *((xsdc__unsignedShort*)(output[i])) );
+
+ axiscAxisDelete(arrayResult, XSDC_ARRAY);
+ }
+
+ // Test complex type
+ {
+ SimpleComplexType complexTypeInput;
+ SimpleComplexType* complexTypeResult;
+
+ complexTypeInput.complexTypeElement = 12345;
+ complexTypeResult = asComplexType(ws, &complexTypeInput);
+ printf("within complex type=%hu\n" , complexTypeResult->complexTypeElement );
+ Axis_Delete_SimpleComplexType(complexTypeResult, 0);
+ }
+
+ // Tests now complete
+ destroy_XSD_unsignedShort_stub(ws);
+
+ printf( "---------------------- TEST COMPLETE -----------------------------\n");
+
+ return 0;
+}
Added: webservices/axis/trunk/c/tests/auto_build/testcases/tests/XSD_QNameC.xml
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/tests/XSD_QNameC.xml?rev=405275&view=auto
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/tests/XSD_QNameC.xml (added)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/tests/XSD_QNameC.xml Mon May 8 19:18:01 2006
@@ -0,0 +1,17 @@
+<test>
+ <name>XSD_QNameC</name>
+ <description>Test serialization and deserialization of the XSD built-in simple type QName</description>
+ <clientLang>c</clientLang>
+ <clientCode>XSD_QNameClient.c</clientCode>
+ <wsdl>XSD_QName.wsdl</wsdl>
+ <expected>
+ <output>
+ XSD_QName.expected
+ </output>
+ <serverResponse>
+ XSD_QName_ServerResponse.expected
+ </serverResponse>
+ </expected>
+ <endpoint>http://localhost:80/axis/XSD_QName</endpoint>
+</test>
+
Added: webservices/axis/trunk/c/tests/auto_build/testcases/tests/XSD_positiveIntegerC.xml
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/tests/XSD_positiveIntegerC.xml?rev=405275&view=auto
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/tests/XSD_positiveIntegerC.xml (added)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/tests/XSD_positiveIntegerC.xml Mon May 8 19:18:01 2006
@@ -0,0 +1,17 @@
+<test>
+ <name>XSD_positiveIntegerC</name>
+ <description>Test serialization and deserialization of the XSD built-in simple type positiveInteger</description>
+ <clientLang>c</clientLang>
+ <clientCode>XSD_positiveIntegerClient.c</clientCode>
+ <wsdl>XSD_positiveInteger.wsdl</wsdl>
+ <expected>
+ <output>
+ XSD_positiveInteger.expected
+ </output>
+ <serverResponse>
+ XSD_positiveInteger_ServerResponse.expected
+ </serverResponse>
+ </expected>
+ <endpoint>http://localhost:80/axis/XSD_positiveInteger</endpoint>
+</test>
+
Added: webservices/axis/trunk/c/tests/auto_build/testcases/tests/XSD_shortC.xml
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/tests/XSD_shortC.xml?rev=405275&view=auto
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/tests/XSD_shortC.xml (added)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/tests/XSD_shortC.xml Mon May 8 19:18:01 2006
@@ -0,0 +1,17 @@
+<test>
+ <name>XSD_shortC</name>
+ <description>Test serialization and deserialization of the XSD built-in simple type short</description>
+ <clientLang>c</clientLang>
+ <clientCode>XSD_shortClient.c</clientCode>
+ <wsdl>XSD_short.wsdl</wsdl>
+ <expected>
+ <output>
+ XSD_short.expected
+ </output>
+ <serverResponse>
+ XSD_short_ServerResponse.expected
+ </serverResponse>
+ </expected>
+ <endpoint>http://localhost:80/axis/XSD_short</endpoint>
+</test>
+
Added: webservices/axis/trunk/c/tests/auto_build/testcases/tests/XSD_stringC.xml
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/tests/XSD_stringC.xml?rev=405275&view=auto
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/tests/XSD_stringC.xml (added)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/tests/XSD_stringC.xml Mon May 8 19:18:01 2006
@@ -0,0 +1,17 @@
+<test>
+ <name>XSD_stringC</name>
+ <description>Test serialization and deserialization of the XSD built-in simple type string</description>
+ <clientLang>c</clientLang>
+ <clientCode>XSD_stringClient.c</clientCode>
+ <wsdl>XSD_string.wsdl</wsdl>
+ <expected>
+ <output>
+ XSD_string.expected
+ </output>
+ <serverResponse>
+ XSD_string_ServerResponse.expected
+ </serverResponse>
+ </expected>
+ <endpoint>http://localhost:80/axis/XSD_string</endpoint>
+</test>
+
Added: webservices/axis/trunk/c/tests/auto_build/testcases/tests/XSD_timeC.xml
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/tests/XSD_timeC.xml?rev=405275&view=auto
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/tests/XSD_timeC.xml (added)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/tests/XSD_timeC.xml Mon May 8 19:18:01 2006
@@ -0,0 +1,17 @@
+<test>
+ <name>XSD_timeC</name>
+ <description>Test serialization and deserialization of the XSD built-in simple type time</description>
+ <clientLang>c</clientLang>
+ <clientCode>XSD_timeClient.c</clientCode>
+ <wsdl>XSD_time.wsdl</wsdl>
+ <expected>
+ <output>
+ XSD_time.expected
+ </output>
+ <serverResponse>
+ XSD_time_ServerResponse.expected
+ </serverResponse>
+ </expected>
+ <endpoint>http://localhost:80/axis/XSD_time</endpoint>
+</test>
+
Added: webservices/axis/trunk/c/tests/auto_build/testcases/tests/XSD_tokenC.xml
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/tests/XSD_tokenC.xml?rev=405275&view=auto
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/tests/XSD_tokenC.xml (added)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/tests/XSD_tokenC.xml Mon May 8 19:18:01 2006
@@ -0,0 +1,17 @@
+<test>
+ <name>XSD_tokenC</name>
+ <description>Test serialization and deserialization of the XSD built-in simple type token</description>
+ <clientLang>c</clientLang>
+ <clientCode>XSD_tokenClient.c</clientCode>
+ <wsdl>XSD_token.wsdl</wsdl>
+ <expected>
+ <output>
+ XSD_token.expected
+ </output>
+ <serverResponse>
+ XSD_token_ServerResponse.expected
+ </serverResponse>
+ </expected>
+ <endpoint>http://localhost:80/axis/XSD_token</endpoint>
+</test>
+
Added: webservices/axis/trunk/c/tests/auto_build/testcases/tests/XSD_unsignedByteC.xml
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/tests/XSD_unsignedByteC.xml?rev=405275&view=auto
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/tests/XSD_unsignedByteC.xml (added)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/tests/XSD_unsignedByteC.xml Mon May 8 19:18:01 2006
@@ -0,0 +1,17 @@
+<test>
+ <name>XSD_unsignedByteC</name>
+ <description>Test serialization and deserialization of the XSD built-in simple type unsignedByte</description>
+ <clientLang>c</clientLang>
+ <clientCode>XSD_unsignedByteClient.c</clientCode>
+ <wsdl>XSD_unsignedByte.wsdl</wsdl>
+ <expected>
+ <output>
+ XSD_unsignedByte.expected
+ </output>
+ <serverResponse>
+ XSD_unsignedByte_ServerResponse.expected
+ </serverResponse>
+ </expected>
+ <endpoint>http://localhost:80/axis/XSD_unsignedByte</endpoint>
+</test>
+
Added: webservices/axis/trunk/c/tests/auto_build/testcases/tests/XSD_unsignedIntC.xml
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/tests/XSD_unsignedIntC.xml?rev=405275&view=auto
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/tests/XSD_unsignedIntC.xml (added)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/tests/XSD_unsignedIntC.xml Mon May 8 19:18:01 2006
@@ -0,0 +1,17 @@
+<test>
+ <name>XSD_unsignedIntC</name>
+ <description>Test serialization and deserialization of the XSD built-in simple type unsignedInt</description>
+ <clientLang>c</clientLang>
+ <clientCode>XSD_unsignedIntClient.c</clientCode>
+ <wsdl>XSD_unsignedInt.wsdl</wsdl>
+ <expected>
+ <output>
+ XSD_unsignedInt.expected
+ </output>
+ <serverResponse>
+ XSD_unsignedInt_ServerResponse.expected
+ </serverResponse>
+ </expected>
+ <endpoint>http://localhost:80/axis/XSD_unsignedInt</endpoint>
+</test>
+
Added: webservices/axis/trunk/c/tests/auto_build/testcases/tests/XSD_unsignedLongC.xml
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/tests/XSD_unsignedLongC.xml?rev=405275&view=auto
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/tests/XSD_unsignedLongC.xml (added)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/tests/XSD_unsignedLongC.xml Mon May 8 19:18:01 2006
@@ -0,0 +1,17 @@
+<test>
+ <name>XSD_unsignedLongC</name>
+ <description>Test serialization and deserialization of the XSD built-in simple type unsignedLong</description>
+ <clientLang>c</clientLang>
+ <clientCode>XSD_unsignedLongClient.c</clientCode>
+ <wsdl>XSD_unsignedLong.wsdl</wsdl>
+ <expected>
+ <output>
+ XSD_unsignedLong.expected
+ </output>
+ <serverResponse>
+ XSD_unsignedLong_ServerResponse.expected
+ </serverResponse>
+ </expected>
+ <endpoint>http://localhost:80/axis/XSD_unsignedLong</endpoint>
+</test>
+
Added: webservices/axis/trunk/c/tests/auto_build/testcases/tests/XSD_unsignedShortC.xml
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/tests/XSD_unsignedShortC.xml?rev=405275&view=auto
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/tests/XSD_unsignedShortC.xml (added)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/tests/XSD_unsignedShortC.xml Mon May 8 19:18:01 2006
@@ -0,0 +1,17 @@
+<test>
+ <name>XSD_unsignedShortC</name>
+ <description>Test serialization and deserialization of the XSD built-in simple type unsignedShort</description>
+ <clientLang>c</clientLang>
+ <clientCode>XSD_unsignedShortClient.c</clientCode>
+ <wsdl>XSD_unsignedShort.wsdl</wsdl>
+ <expected>
+ <output>
+ XSD_unsignedShort.expected
+ </output>
+ <serverResponse>
+ XSD_unsignedShort_ServerResponse.expected
+ </serverResponse>
+ </expected>
+ <endpoint>http://localhost:80/axis/XSD_unsignedShort</endpoint>
+</test>
+