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 di...@apache.org on 2005/11/15 17:19:50 UTC
svn commit: r344387 - in /webservices/axis/trunk/c:
src/wsdl/org/apache/axis/wsdl/wsdl2ws/ tests/auto_build/testcases/client/cpp/
Author: dicka
Date: Tue Nov 15 08:19:40 2005
New Revision: 344387
URL: http://svn.apache.org/viewcvs?rev=344387&view=rev
Log:
Resolve problem with array inner type.
Also, updating affected testcases to use the updated arrays API.
Modified:
webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/WSDL2Ws.java
webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/SimpleTypeInnerUnboundedClient.cpp
webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/SimpleTypeInnerUnboundedInOutputClient.cpp
Modified: webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/WSDL2Ws.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/WSDL2Ws.java?rev=344387&r1=344386&r2=344387&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/WSDL2Ws.java (original)
+++ webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/WSDL2Ws.java Tue Nov 15 08:19:40 2005
@@ -1125,7 +1125,7 @@
// If there is a ref type and the ref type is not currently exposed because it's an "inner" type (marked by ">")then make sure the ref type is exposed to the user as a class
// in order to expose it we simply change the name !
TypeEntry referencedType =defType.getRefType();
- if(referencedType!=null && referencedType.getQName().getLocalPart().startsWith(">"))
+ if(referencedType!=null && referencedType.getQName().getLocalPart().startsWith(">") && referencedType.getQName().getLocalPart().lastIndexOf(">") == 0)
{
if(WSDL2Ws.verbose)
{
Modified: webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/SimpleTypeInnerUnboundedClient.cpp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/SimpleTypeInnerUnboundedClient.cpp?rev=344387&r1=344386&r2=344387&view=diff
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/SimpleTypeInnerUnboundedClient.cpp (original)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/SimpleTypeInnerUnboundedClient.cpp Tue Nov 15 08:19:40 2005
@@ -53,7 +53,6 @@
Type1 *input = new Type1();
Type1* result;
- char *idents[10];
int i;
input->enum_int = ENUMTYPEINT_1;
@@ -62,11 +61,24 @@
input->att_enum_string = strdup("one");
input->att_enum_int = ENUMTYPEINT_1;
- input->ident.m_Array = idents;
- input->ident.m_Size = 10;
- for ( i = 0; i < 10; i++ ) {
- idents[i] = strdup ("Hello world");
+ int identSize = 10;
+ xsd__string* idents = new xsd__string[identSize];
+ char message[12] = "Hello world";
+ for (i = 0 ; i < identSize ; i++)
+ {
+ idents[i] = new char[12];
+ strcpy(idents[i], message);
}
+ xsd__string_Array ident;
+ ident.set(idents, identSize);
+ input->setident(&ident);
+
+ // clear up input array
+ for (i = 0 ; i < identSize ; i++)
+ {
+ delete idents[i];
+ }
+ delete [] idents;
result = ws->getInput(input);
Modified: webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/SimpleTypeInnerUnboundedInOutputClient.cpp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/SimpleTypeInnerUnboundedInOutputClient.cpp?rev=344387&r1=344386&r2=344387&view=diff
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/SimpleTypeInnerUnboundedInOutputClient.cpp (original)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/SimpleTypeInnerUnboundedInOutputClient.cpp Tue Nov 15 08:19:40 2005
@@ -59,11 +59,30 @@
if ( result == NULL )
cout << "NULL" << endl;
- else {
- char **pTemp = result->ident.m_Array;
- for ( i = 0; i < result->ident.m_Size; i++ ) {
- cout << "Result [" << i << "] : " << pTemp[i] << endl;
- }
+ else
+ {
+
+ xsd__string_Array * output = result->getident();
+ int size = 0;
+ const xsd__string* array = output->get(size);
+ if (array != NULL)
+ {
+ if (size > 0)
+ {
+ for ( i = 0 ; i < size ; i++)
+ {
+ cout << "Result [" << i << "] : " << array[i] << endl;
+ }
+ }
+ else
+ {
+ cout << "empty array" << endl;
+ }
+ }
+ else
+ {
+ cout << "NULL array" << endl;
+ }
returnValue = 0; // Success
}
bSuccess = true;