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/04 03:21:44 UTC
svn commit: r399506 - in
/webservices/axis/trunk/c/tests/auto_build/testcases:
client/c/XSD_IDClient.c client/c/XSD_NCNameClient.c
client/cpp/XSD_IDClient.cpp client/cpp/XSD_NCNameClient.cpp
tests/XSD_NCNameC.xml
Author: nadiramra
Date: Wed May 3 18:21:41 2006
New Revision: 399506
URL: http://svn.apache.org/viewcvs?rev=399506&view=rev
Log:
C support fixes/enhancements. Testcases for C bindings.
Added:
webservices/axis/trunk/c/tests/auto_build/testcases/client/c/XSD_NCNameClient.c
webservices/axis/trunk/c/tests/auto_build/testcases/tests/XSD_NCNameC.xml
Modified:
webservices/axis/trunk/c/tests/auto_build/testcases/client/c/XSD_IDClient.c
webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_IDClient.cpp
webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_NCNameClient.cpp
Modified: webservices/axis/trunk/c/tests/auto_build/testcases/client/c/XSD_IDClient.c
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/client/c/XSD_IDClient.c?rev=399506&r1=399505&r2=399506&view=diff
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/client/c/XSD_IDClient.c (original)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/client/c/XSD_IDClient.c Wed May 3 18:21:41 2006
@@ -43,7 +43,12 @@
url = argv[1];
sprintf(endpoint, "%s", url);
- ws = get_XSD_IDPort_stub(url);
+ ws = get_XSD_IDPort_stub(url);
+ if (!ws)
+ {
+ printf("FAILED to get WS\n");
+ return -1;
+ }
// Test non-nillable element
input = (xsdc__ID)axiscAxisNew(XSDC_ID,25);
@@ -61,6 +66,8 @@
printf("non-nillable element=%s\n", result);
else
printf("non-nillable element=<empty>\n");
+
+ axiscAxisDelete(result, XSDC_ID);
}
else
printf("non-nillable element=<nil>\n");
@@ -81,6 +88,8 @@
printf("empty non-nillable element=%s\n", result);
else
printf("empty non-nillable element=<empty>\n");
+
+ axiscAxisDelete(result, XSDC_ID);
}
else
printf("empty non-nillable element=<nil>\n");
@@ -100,6 +109,8 @@
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_ID);
}
else
printf("non-nillable element with XML reserved characters=<nil>\n");
@@ -117,6 +128,8 @@
printf("non-nillable element with whitespace characters=\"%s\"\n", result);
else
printf("non-nillable element with whitespace characters=<empty>\n");
+
+ axiscAxisDelete(result, XSDC_ID);
}
else
printf("non-nillable element with whitespace characters=<nil>\n");
@@ -135,6 +148,7 @@
printf("nillable element=%s\n", result);
else
printf("nillable element=<empty>\n");
+
axiscAxisDelete(result, XSDC_ID);
}
else
@@ -156,6 +170,7 @@
printf("empty nillable element=%s\n", result);
else
printf("empty nillable element=<empty>\n");
+
axiscAxisDelete(result, XSDC_ID);
}
else
@@ -175,6 +190,7 @@
printf("nil element=%s\n", result);
else
printf("nil element=<empty>\n");
+
axiscAxisDelete(result, XSDC_ID);
}
else
@@ -342,6 +358,10 @@
complexTypeInput.complexTypeElement = input;
complexTypeResult = asComplexType(ws, &complexTypeInput);
+
+ if (exceptionOccurred == C_TRUE
+ || get_XSD_IDPort_Status(ws) == AXISC_FAIL )
+ printf ("Failed\n");
if (complexTypeResult->complexTypeElement)
{
Added: webservices/axis/trunk/c/tests/auto_build/testcases/client/c/XSD_NCNameClient.c
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/client/c/XSD_NCNameClient.c?rev=399506&view=auto
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/client/c/XSD_NCNameClient.c (added)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/client/c/XSD_NCNameClient.c Wed May 3 18:21:41 2006
@@ -0,0 +1,317 @@
+// 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_NCName.h"
+
+
+int main(int argc, char* argv[])
+{
+ AXISCHANDLE ws;
+
+ xsdc__NCName input;
+ xsdc__NCName result;
+
+ RequiredAttributeElement requiredAttributeInput;
+ RequiredAttributeElement* requiredAttributeResult;
+
+ char endpoint[256];
+ const char* url="http://localhost:80/axis/XSD_NCName";
+
+ char emptyNCName[1] = "";
+ char simpleNCName[25] = "xml.si-mple_name ";
+
+ if(argc>1)
+ url = argv[1];
+
+ sprintf(endpoint, "%s", url);
+ ws = get_XSD_NCName_stub(endpoint);
+ if (!ws)
+ {
+ printf("FAILED to get WS\n");
+ return -1;
+ }
+
+ // Test non-nillable element
+ result = asNonNillableElement(ws, simpleNCName);
+ if (exceptionOccurred == C_TRUE
+ || get_XSD_NCName_Status(ws) == AXISC_FAIL )
+ printf ("Failed\n");
+
+ if (result)
+ {
+ if (*result)
+ printf("non-nillable element=%s\n", result );
+ else
+ printf("non-nillable element=<empty>\n" );
+
+ axiscAxisDelete(result, XSDC_NCNAME);
+ }
+ else
+ printf("non-nillable element=<nil>\n" );
+
+ // Test empty non-nillable element
+ input = (xsdc__NCName)axiscAxisNew(XSDC_NCNAME, 1);
+ strcpy (input, emptyNCName);
+
+ result = asNonNillableElement(ws, input);
+ if (exceptionOccurred == C_TRUE
+ || get_XSD_NCName_Status(ws) == AXISC_FAIL )
+ printf ("Failed\n");
+
+ if (result)
+ {
+ if (*result)
+ printf("empty non-nillable element=%s\n", result );
+ else
+ printf("empty non-nillable element=<empty>\n" );
+
+ axiscAxisDelete(result, XSDC_NCNAME);
+ }
+ else
+ printf("empty non-nillable element=<nil>\n" );
+
+ axiscAxisDelete(input, XSDC_NCNAME);
+
+ // Test nillable element, with a value
+ input = simpleNCName;
+ result = asNillableElement(ws, input);
+ if (exceptionOccurred == C_TRUE
+ || get_XSD_NCName_Status(ws) == AXISC_FAIL )
+ printf ("Failed\n");
+
+ if (result)
+ {
+ if (*result)
+ printf("nillable element=%s\n", result );
+ else
+ printf("nillable element=<empty>\n" );
+
+ axiscAxisDelete(result, XSDC_NCNAME);
+ }
+ else
+ printf("nillable element=<nil>\n" );
+
+ // Test empty nillable element
+ input = emptyNCName;
+ result = asNillableElement(ws, input);
+ if (exceptionOccurred == C_TRUE
+ || get_XSD_NCName_Status(ws) == AXISC_FAIL )
+ printf ("Failed\n");
+
+ if (result)
+ {
+ if (*result)
+ printf("empty nillable element=%s\n", result );
+ else
+ printf("empty nillable element=<empty>\n" );
+
+ axiscAxisDelete(result, XSDC_NCNAME);
+ }
+ else
+ printf("empty nillable element=<nil>\n" );
+
+ // Test nillable element, with nil
+ result = asNillableElement(ws, NULL);
+ if (exceptionOccurred == C_TRUE
+ || get_XSD_NCName_Status(ws) == AXISC_FAIL )
+ printf ("Failed\n");
+
+ if (result)
+ {
+ if (*result)
+ printf("nil element=%s\n", result );
+ else
+ printf("nil element=<empty>\n" );
+
+ axiscAxisDelete(result, XSDC_NCNAME);
+ }
+ else
+ printf("nil element=<nil>\n" );
+
+ // Test required attribute
+ requiredAttributeInput.requiredAttribute = simpleNCName;
+ requiredAttributeResult = asRequiredAttribute(ws, &requiredAttributeInput);
+ if (exceptionOccurred == C_TRUE
+ || get_XSD_NCName_Status(ws) == AXISC_FAIL )
+ printf ("Failed\n");
+
+ 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 = emptyNCName;
+ requiredAttributeResult = asRequiredAttribute(ws, &requiredAttributeInput);
+ if (exceptionOccurred == C_TRUE
+ || get_XSD_NCName_Status(ws) == AXISC_FAIL )
+ printf ("Failed\n");
+
+ 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, simpleNCName);
+ OptionalAttributeElement optionalAttributeInput;
+ optionalAttributeInput.setoptionalAttribute(input);
+ OptionalAttributeElement* optionalAttributeResult = ws->asOptionalAttribute(&optionalAttributeInput);
+ if (optionalAttributeResult->getoptionalAttribute())
+ {
+ if (*(optionalAttributeResult->getoptionalAttribute()))
+ printf("optional attribute, with data=%s\n", optionalAttributeResult->getoptionalAttribute() );
+ else
+ printf("optional attribute, with data=<empty>" );
+ }
+ else
+ printf("optional attribute, with data=<not present>" );
+
+ delete [] input;
+ delete optionalAttributeResult;
+
+ // Test empty optional attribute
+ input = new char[1];
+ strcpy (input, emptyNCName);
+ optionalAttributeInput.setoptionalAttribute(input);
+ optionalAttributeResult = ws->asOptionalAttribute(&optionalAttributeInput);
+ if (optionalAttributeResult->getoptionalAttribute())
+ {
+ if (*(optionalAttributeResult->getoptionalAttribute()))
+ printf("empty optional attribute=%s\n", optionalAttributeResult->getoptionalAttribute() );
+ else
+ printf("empty optional attribute=<empty>" );
+ }
+ else
+ printf("empty optional attribute=<not present>" );
+
+ 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=%s\n", optionalAttributeResult->getoptionalAttribute() );
+ else
+ printf("optional attribute, not present=<empty>" );
+ }
+ else
+ printf("optional attribute, not present=<not present>" );
+ delete optionalAttributeResult;
+*/
+
+ // Test array
+ {
+#define ARRAY_SIZE 2
+ int i;
+ xsdc__NCName_Array arrayInput;
+ xsdc__NCName_Array* arrayResult;
+ xsdc__NCName array[ARRAY_SIZE];
+ const xsdc__NCName* output;
+ int outputSize=0;
+
+ for (i=0 ; i < ARRAY_SIZE; i++)
+ array[i]= simpleNCName;
+
+ arrayInput.m_Array = array;
+ arrayInput.m_Size = ARRAY_SIZE;
+ arrayInput.m_Type = XSDC_NCNAME;
+
+ arrayResult = asArray(ws, &arrayInput);
+
+ if (exceptionOccurred == C_TRUE
+ || get_XSD_NCName_Status(ws) == AXISC_FAIL )
+ printf ("Failed\n");
+
+ 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 = simpleNCName;
+ complexTypeResult = asComplexType(ws, &complexTypeInput);
+
+ if (exceptionOccurred == C_TRUE
+ || get_XSD_NCName_Status(ws) == AXISC_FAIL )
+ printf ("Failed\n");
+
+ 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_NCName_stub(ws);
+
+ printf("---------------------- TEST COMPLETE -----------------------------\n");
+
+ return 0;
+}
Modified: webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_IDClient.cpp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_IDClient.cpp?rev=399506&r1=399505&r2=399506&view=diff
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_IDClient.cpp (original)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_IDClient.cpp Wed May 3 18:21:41 2006
@@ -13,6 +13,14 @@
// See the License for the specific language governing permissions and
// limitations under the License.
+/* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! */
+/* NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE */
+/* ---------------------------------------------------------------- */
+/* CHANGES TO THIS FILE MAY ALSO REQUIRE CHANGES TO THE */
+/* C-EQUIVALENT FILE. PLEASE ENSURE THAT IT IS DONE. */
+/* ---------------------------------------------------------------- */
+/* NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE */
+/* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! */
#include "XSD_IDPort.hpp"
#include <axis/AxisException.hpp>
@@ -25,6 +33,9 @@
xsd__ID result = NULL;
xsd__ID input = NULL;
+ RequiredAttributeElement requiredAttributeInput;
+ RequiredAttributeElement* requiredAttributeResult;
+
char emptyID[1] = "";
char simpleID[25] = "A simple test message!";
char reservedCharactersID[] = "<>&\"\'";
@@ -149,9 +160,10 @@
// Test required attribute
input = new char[25];
strcpy (input, simpleID);
- RequiredAttributeElement requiredAttributeInput;
+
requiredAttributeInput.setrequiredAttribute(input);
- RequiredAttributeElement* requiredAttributeResult = ws->asRequiredAttribute(&requiredAttributeInput);
+ requiredAttributeResult = ws->asRequiredAttribute(&requiredAttributeInput);
+
if (requiredAttributeResult->getrequiredAttribute())
{
if (*(requiredAttributeResult->getrequiredAttribute()))
Modified: webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_NCNameClient.cpp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_NCNameClient.cpp?rev=399506&r1=399505&r2=399506&view=diff
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_NCNameClient.cpp (original)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_NCNameClient.cpp Wed May 3 18:21:41 2006
@@ -14,6 +14,15 @@
// 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 "XSD_NCName.hpp"
#include <axis/AxisException.hpp>
#include <ctype.h>
@@ -22,170 +31,148 @@
int main(int argc, char* argv[])
{
+ XSD_NCName* ws;
+
+ xsd__NCName input;
+ xsd__NCName result;
+
+ RequiredAttributeElement requiredAttributeInput;
+ RequiredAttributeElement* requiredAttributeResult;
+
char endpoint[256];
const char* url="http://localhost:80/axis/XSD_NCName";
+ char emptyNCName[1] = "";
+ char simpleNCName[25] = "xml.si-mple_name ";
+
if(argc>1)
url = argv[1];
try
{
sprintf(endpoint, "%s", url);
- XSD_NCName* ws = new XSD_NCName(endpoint);
+ ws = new XSD_NCName(endpoint);
- char emptyNCName[1] = "";
- xsd__NCName emptyInput = new char[1];
- strcpy (emptyInput, emptyNCName);
- char simpleNCName[25] = "xml.si-mple_name ";
- xsd__NCName input = new char[25];
+ input = new char[25];
strcpy (input, simpleNCName);
// Test non-nillable element
- xsd__NCName 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;
- }
}
else
- {
cout << "non-nillable element=<nil>" << endl;
- }
+
delete [] input;
// Test empty non-nillable element
- result = ws->asNonNillableElement(emptyInput);
+ xsd__NCName input = new char[1];
+ strcpy (input, emptyNCName);
+
+ result = ws->asNonNillableElement(input);
if (result)
{
if (*result)
- {
cout << "empty non-nillable element=" << result << endl;
- }
else
- {
cout << "empty non-nillable element=<empty>" << endl;
- }
}
else
- {
cout << "empty non-nillable element=<nil>" << endl;
- }
- delete [] emptyInput;
+
+ delete [] input;
// Test nillable element, with a value
input = new char[25];
strcpy (input, simpleNCName);
- xsd__NCName nillableResult = ws->asNillableElement(input);
- if (nillableResult)
+ xsd__NCName 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, emptyNCName);
- nillableResult = ws->asNillableElement(emptyInput);
- if (nillableResult)
+ input = new char[1];
+ strcpy (input, emptyNCName);
+ 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, simpleNCName);
- RequiredAttributeElement requiredAttributeInput;
+
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, emptyNCName);
- requiredAttributeInput;
- requiredAttributeInput.setrequiredAttribute(emptyInput);
+ input = new char[1];
+ strcpy (input, emptyNCName);
+
+ 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
@@ -199,42 +186,32 @@
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, emptyNCName);
- optionalAttributeInput.setoptionalAttribute(emptyInput);
+ input = new char[1];
+ strcpy (input, emptyNCName);
+ 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
@@ -243,18 +220,12 @@
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;
*/
@@ -266,11 +237,10 @@
{
array[inputIndex]= new char[25];
strcpy (array[inputIndex], simpleNCName);
-
}
arrayInput.set(array,arraySize);
xsd__NCName_Array* arrayResult = ws->asArray(&arrayInput);
- int outputSize = 0;
+ int outputSize = 0;
const xsd__NCName* output = arrayResult->get(outputSize);
cout << "array of " << outputSize << " elements" << endl;
for (int index = 0; index < outputSize ; index++)
@@ -278,24 +248,17 @@
if (output !=NULL)
{
if (output[index]!=NULL)
- {
cout << " element[" << index << "]=" << output[index] << endl;
- }
else
- {
cout << " element[" << index << "]=<empty>" << endl;
- }
- }
+ }
else
- {
cout << " element[" << index << "]=<nil>" << endl;
- }
}
// Clear up input array
for (int deleteIndex = 0 ; deleteIndex < arraySize ; deleteIndex++ )
- {
delete array[deleteIndex];
- }
+
delete [] array;
delete arrayResult;
@@ -308,18 +271,13 @@
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_NCNameC.xml
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/tests/XSD_NCNameC.xml?rev=399506&view=auto
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/tests/XSD_NCNameC.xml (added)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/tests/XSD_NCNameC.xml Wed May 3 18:21:41 2006
@@ -0,0 +1,17 @@
+<test>
+ <name>XSD_NCNameC</name>
+ <description>Test serialization and deserialization of the XSD built-in simple type NCName</description>
+ <clientLang>c</clientLang>
+ <clientCode>XSD_NCNameClient.c</clientCode>
+ <wsdl>XSD_NCName.wsdl</wsdl>
+ <expected>
+ <output>
+ XSD_NCName.expected
+ </output>
+ <serverResponse>
+ XSD_NCName_ServerResponse.expected
+ </serverResponse>
+ </expected>
+ <endpoint>http://localhost:80/axis/XSD_NCName</endpoint>
+</test>
+