You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by di...@apache.org on 2006/01/25 14:16:25 UTC
svn commit: r372203 - in /webservices/axis/trunk/c:
src/wsdl/org/apache/axis/wsdl/wsdl2ws/
src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/
src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/
tests/auto_build/testcases/client/cpp/
Author: dicka
Date: Wed Jan 25 05:16:12 2006
New Revision: 372203
URL: http://svn.apache.org/viewcvs?rev=372203&view=rev
Log:
Resolve problems with anonymous types that are restrictions of simple types.
Modified:
webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/ParamWriter.java
webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/BeanParamWriter.java
webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ParmHeaderFileWriter.java
webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/AllParamWriter.java
webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/BeanParamWriter.java
webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/ParmHeaderFileWriter.java
webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/SimpleTypeInnerUnboundedClient.cpp
Modified: webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/ParamWriter.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/ParamWriter.java?rev=372203&r1=372202&r2=372203&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/ParamWriter.java (original)
+++ webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/ParamWriter.java Wed Jan 25 05:16:12 2006
@@ -253,7 +253,7 @@
}
else
{
- if (!attrib.isSimpleType())
+ if (!(attrib.isSimpleType() || attrib.getType().isSimpleType()))
{
return attrib.getTypeName() + "*";
}
@@ -322,5 +322,53 @@
}
}
}
+ }
+
+ protected boolean isElementNillable(int index)
+ {
+ boolean bNillable = false;
+
+ if (!attribs[index].isArray())
+ {
+ if (attribs[index].isSimpleType())
+ {
+ if (!CUtils.isPointerType(attribs[index].getTypeName()))
+ {
+ bNillable = attribs[index].isNillable();
+ }
+ }
+ else if (attribs[index].getType().isSimpleType())
+ {
+ if (!CUtils.isPointerType(CUtils.getclass4qname(attribs[index].getType().getBaseType())))
+ {
+ bNillable = attribs[index].isNillable();
+ }
+ }
+ }
+ return bNillable;
+ }
+
+ protected boolean isElementOptional(int index)
+ {
+ boolean bOptional = false;
+
+ if (!attribs[index].isArray())
+ {
+ if (attribs[index].isSimpleType())
+ {
+ if (!CUtils.isPointerType(attribs[index].getTypeName()))
+ {
+ bOptional = attribs[index].isOptional();
+ }
+ }
+ else if (attribs[index].getType().isSimpleType())
+ {
+ if (!CUtils.isPointerType(CUtils.getclass4qname(attribs[index].getType().getBaseType())))
+ {
+ bOptional = attribs[index].isOptional();
+ }
+ }
+ }
+ return bOptional;
}
}
Modified: webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/BeanParamWriter.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/BeanParamWriter.java?rev=372203&r1=372202&r2=372203&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/BeanParamWriter.java (original)
+++ webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/BeanParamWriter.java Wed Jan 25 05:16:12 2006
@@ -942,23 +942,4 @@
throw new WrapperFault(e);
}
}
-
- // FJP Nillable vv
- protected boolean isElementNillable(int index)
- {
- ElementInfo ei = type.getElementForElementName(attribs[index].getParamName());
- boolean bNillable = false;
-
- if (ei != null
- && !("xsd__string".equalsIgnoreCase(attribs[index].getTypeName()))
- || "xsd__anyURI".equalsIgnoreCase(attribs[index].getTypeName())
- || "xsd__QName".equalsIgnoreCase(attribs[index].getTypeName())
- || "xsd__NOTATION".equalsIgnoreCase(attribs[index].getTypeName()))
- {
- bNillable = ei.getNillable();
- }
-
- return bNillable;
- }
- // FJP Nillable ^^
}
Modified: webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ParmHeaderFileWriter.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ParmHeaderFileWriter.java?rev=372203&r1=372202&r2=372203&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ParmHeaderFileWriter.java (original)
+++ webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ParmHeaderFileWriter.java Wed Jan 25 05:16:12 2006
@@ -380,24 +380,4 @@
protected String getFileType() {
return "Param";
}
-
- // FJP Nillable vv
- protected boolean isElementNillable(int index) {
- ElementInfo ei = type.getElementForElementName(attribs[index]
- .getParamName());
- boolean bNillable = false;
-
- if (ei != null
- && !("xsd__string".equalsIgnoreCase(attribs[index]
- .getTypeName()))
- || "xsd__anyURI".equalsIgnoreCase(attribs[index].getTypeName())
- || "xsd__QName".equalsIgnoreCase(attribs[index].getTypeName())
- || "xsd__NOTATION".equalsIgnoreCase(attribs[index]
- .getTypeName())) {
- bNillable = ei.getNillable();
- }
-
- return bNillable;
- }
- // FJP Nillable ^^
}
Modified: webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/AllParamWriter.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/AllParamWriter.java?rev=372203&r1=372202&r2=372203&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/AllParamWriter.java (original)
+++ webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/AllParamWriter.java Wed Jan 25 05:16:12 2006
@@ -86,6 +86,20 @@
System.out.println("Array writer called ......");
}
QName qname = type.getName();
+
+
+ String elementType = type.getElementType();
+ elementType = elementType.replace('>', '_');
+ QName elementQname = new QName(qname.getNamespaceURI(), elementType);
+ Type currentType = wscontext.getTypemap().getType(elementQname);
+ if (currentType != null)
+ {
+ if ( currentType.isSimpleType())
+ {
+ continue;
+ }
+ }
+
if (CUtils.isSimpleType(qname)
&& !CUtils.isDefinedSimpleType(qname))
{
Modified: webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/BeanParamWriter.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/BeanParamWriter.java?rev=372203&r1=372202&r2=372203&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/BeanParamWriter.java (original)
+++ webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/BeanParamWriter.java Wed Jan 25 05:16:12 2006
@@ -359,13 +359,23 @@
+ "("
+ properParamName
+ " InValue");
- if(attribs[i].isSimpleType() && (CUtils.isPointerType(properParamName) || attribs[i].getAllElement() || attribs[i].getChoiceElement()))
+ Type attributeType = attribs[i].getType();
+ boolean isPointerType = false;
+ if (attributeType.isSimpleType())
+ {
+ isPointerType = CUtils.isPointerType(CUtils.getclass4qname(attributeType.getBaseType()));
+ }
+ else
+ {
+ isPointerType = CUtils.isPointerType(getCorrectParmNameConsideringArraysAndComplexTypes(attribs[i]));
+ }
+ if((attribs[i].isSimpleType() || attribs[i].getType().isSimpleType()) && (isPointerType || attribs[i].getAllElement() || attribs[i].getChoiceElement()))
{
writer.write(", bool deep");
}
writer.write(")\n{\n");
- if(CUtils.isPointerType(properParamName))
+ if(isPointerType)
{
writer.write("\tif (" + parameterName + " != NULL)\n");
writer.write("\t{\n");
@@ -393,7 +403,7 @@
writer.write("\t}\n");
writer.write("\t__axis_deepcopy_" + parameterName + " = deep;\n");
}
- else if (attribs[i].isSimpleType() && (attribs[i].getAllElement() || attribs[i].getChoiceElement()))
+ else if ((attribs[i].isSimpleType() || attribs[i].getType().isSimpleType()) && (attribs[i].getAllElement() || attribs[i].getChoiceElement()))
{
writer.write("\tif (" + parameterName + " != NULL)\n");
writer.write("\t{\n");
@@ -523,7 +533,7 @@
writer.write("\t/* If there are any attributes serialize them. If there aren't then close the tag */\n");
for (int i = 0; i < attributeParamCount; i++)
{
- if (attribs[i].isArray() || !(attribs[i].isSimpleType()))
+ if (attribs[i].isArray() || !(attribs[i].isSimpleType() || attribs[i].getType().isSimpleType()))
{
throw new WrapperFault("Error : an attribute is not basic type");
}
@@ -542,7 +552,20 @@
soapTagName = soapTagName.substring(1, soapTagName.length());
}
//end remove _Ref sufix and _ prefix in SOAP tag name
- if (CUtils.isPointerType(attribs[i].getTypeName()))
+ Type type = attribs[i].getType();
+ boolean isPointerType = false;
+ String basicType = null;
+ if (!attribs[i].isSimpleType() && type.isSimpleType())
+ {
+ basicType = CUtils.getclass4qname(attribs[i].getType().getBaseType());
+ isPointerType = CUtils.isPointerType(CUtils.getclass4qname(type.getBaseType()));
+ }
+ else
+ {
+ basicType = attribs[i].getTypeName();
+ isPointerType = CUtils.isPointerType(attribs[i].getTypeName());
+ }
+ if (isPointerType)
{
writer.write("\tif (0 != param->"
+ attribs[i].getParamNameAsMember() + ")\n");
@@ -551,8 +574,7 @@
+ "\", 0, (void*)(param->"
+ attribs[i].getParamNameAsMember()
+ "), "
- + CUtils.getXSDTypeForBasicType(attribs[i]
- .getTypeName()) + ");\n");
+ + CUtils.getXSDTypeForBasicType(basicType) + ");\n");
}
else
{
@@ -652,15 +674,23 @@
else if (attribs[i].isArray())
{
//if Array
- if (attribs[i].isSimpleType())
+ if (attribs[i].isSimpleType() || attribs[i].getType().isSimpleType())
{
+ String baseTypeName = null;
+ if (!attribs[i].isSimpleType() && attribs[i].getType().isSimpleType())
+ {
+ baseTypeName = CUtils.getclass4qname(attribs[i].getType().getBaseType());
+ }
+ else
+ {
+ baseTypeName = attribs[i].getTypeName();;
+ }
writer.write("\tpSZ->serializeBasicArray(param->"
+ attribs[i].getParamName()
+ ", "
+ namespace
+ ","
- + CUtils.getXSDTypeForBasicType(attribs[i]
- .getTypeName())
+ + CUtils.getXSDTypeForBasicType(baseTypeName)
+ ", \""
+ attribs[i].getParamNameAsSOAPElement()
+ "\");\n");
@@ -690,14 +720,25 @@
+ namespace + ");\n");
}
}
- else if (attribs[i].isSimpleType())
+ else if (attribs[i].isSimpleType() || attribs[i].getType().isSimpleType())
{
+ String typeName = attribs[i].getTypeName();
+ String baseTypeName = null;
+ if (attribs[i].getType().isSimpleType())
+ {
+ baseTypeName = CUtils.getclass4qname (attribs[i].getType().getBaseType ());
+ }
+ else
+ {
+ baseTypeName = typeName;
+ }
+
if (attribs[i].isOptional())
{
writer.write("\tif (param->" + attribs[i].getParamNameWithoutSymbols() + " != NULL)\n\t\t{\n\t");
}
- if (CUtils.isPointerType(attribs[i].getTypeName()))
+ if (CUtils.isPointerType(baseTypeName))
{
writer.write("\t\tpSZ->serializeAsElement(\""
+ attribs[i].getSOAPElementNameAsString()
@@ -706,7 +747,7 @@
+ ", (void*)(param->"
+ attribs[i].getParamNameWithoutSymbols()
+ "), "
- + CUtils.getXSDTypeForBasicType(attribs[i].getTypeName()) + ");\n");
+ + CUtils.getXSDTypeForBasicType(baseTypeName) + ");\n");
}
else
{
@@ -730,7 +771,7 @@
+ ", (void*)(*(param->"
+ attribs[i].getParamNameWithoutSymbols()
+ ")), "
- + CUtils.getXSDTypeForBasicType(attribs[i].getTypeName()) + ");\n");
+ + CUtils.getXSDTypeForBasicType(baseTypeName) + ");\n");
}
else
{
@@ -741,7 +782,7 @@
+ ", (void*)(param->"
+ attribs[i].getParamNameWithoutSymbols()
+ "), "
- + CUtils.getXSDTypeForBasicType(attribs[i].getTypeName()) + ");\n");
+ + CUtils.getXSDTypeForBasicType(baseTypeName) + ");\n");
}
}
else
@@ -753,7 +794,7 @@
+ ", (void*)&(param->"
+ attribs[i].getParamNameWithoutSymbols()
+ "), "
- + CUtils.getXSDTypeForBasicType(attribs[i].getTypeName()) + ");\n");
+ + CUtils.getXSDTypeForBasicType(baseTypeName) + ");\n");
}
}
@@ -937,10 +978,19 @@
{
arrayCount++;
//if Array
- if (attribs[i].isSimpleType())
+ if (attribs[i].isSimpleType() || attribs[i].getType().isSimpleType())
{
+ String baseTypeName = null;
+ if (!attribs[i].isSimpleType() && attribs[i].getType().isSimpleType())
+ {
+ baseTypeName = CUtils.getclass4qname(attribs[i].getType().getBaseType());
+ }
+ else
+ {
+ baseTypeName = attribs[i].getTypeName();;
+ }
writer.write("\tAxis_Array * array" + arrayCount + " = pIWSDZ->getBasicArray("
- + CUtils.getXSDTypeForBasicType(attribs[i].getTypeName()) + ", \""
+ + CUtils.getXSDTypeForBasicType(baseTypeName) + ", \""
+ attribs[i].getParamNameAsSOAPElement()
+ "\",0);\n");
writer.write("\tif(param->" + attribs[i].getParamNameAsMember() + " == NULL)\n");
@@ -971,7 +1021,7 @@
}
}
- else if (attribs[i].isSimpleType())
+ else if ((attribs[i].isSimpleType() || attribs[i].getType().isSimpleType()))
{
//TODO handle optional attributes
//Samisa
@@ -997,12 +1047,22 @@
writer.write("\t\t{\n");
}
+ Type type = attribs[i].getType();
+ boolean isPointerType = false;
+ if (type.isSimpleType())
+ {
+ isPointerType = CUtils.isPointerType(CUtils.getclass4qname(type.getBaseType()));
+ }
+ else
+ {
+ isPointerType = CUtils.isPointerType(attribs[i].getTypeName());
+ }
if (attribs[i].isNillable() ||
isElementNillable(i) ||
isElementOptional(i) ||
- CUtils.isPointerType(attribs[i].getTypeName()))
+ isPointerType)
{
- if (attribs[i].getChoiceElement() && isElementNillable(i) && !attribs[i].getTypeName().equals("xsd__string"))
+ if (attribs[i].getChoiceElement() && isElementNillable(i) && !isPointerType)
{
writer.write("\tparam->"
+ attribs[i].getParamNameAsMember()
@@ -1024,20 +1084,29 @@
else
{
String typeName = attribs[i].getTypeName();
+ String baseTypeName = null;
+ if (type.isSimpleType())
+ {
+ baseTypeName = CUtils.getclass4qname (type.getBaseType ());;
+ }
+ else
+ {
+ baseTypeName = typeName;
+ }
String elementName = attribs[i].getParamNameAsMember();
- if( CUtils.isPointerType( typeName))
+ if( isPointerType)
{
writer.write("\t" + typeName + " pValue" + i + " = pIWSDZ->" +
- CUtils.getParameterGetValueMethodName(typeName, attribs[i].isAttribute()) +
+ CUtils.getParameterGetValueMethodName(baseTypeName, attribs[i].isAttribute()) +
"( \"" + soapTagName + "\", 0);\n\n");
}
else
{
writer.write("\t\t\t" + typeName + " * pValue" + i + " = pIWSDZ->" +
- CUtils.getParameterGetValueMethodName(typeName, attribs[i].isAttribute()) +
+ CUtils.getParameterGetValueMethodName(baseTypeName, attribs[i].isAttribute()) +
"( \"" + soapTagName + "\", 0);\n\n");
}
@@ -1057,7 +1126,7 @@
writer.write("\t\t\t\tparam->set" + localElemName + " (pValue" + i + ");\n");
- writer.write("\t\t\t\tAxis::AxisDelete( (void *) pValue" + i + ", " + CUtils.getXSDTypeForBasicType( typeName) + ");\n\n");
+ writer.write("\t\t\t\tAxis::AxisDelete( (void *) pValue" + i + ", " + CUtils.getXSDTypeForBasicType( baseTypeName) + ");\n\n");
writer.write( "\t\t\t}\n");
}
@@ -1300,7 +1369,17 @@
}
else
{
- if (attribs[i].isSimpleType() && (CUtils.isPointerType(attribs[i].getTypeName()) || attribs[i].isOptional() || attribs[i].isNillable() || attribs[i].getChoiceElement() || attribs[i].getAllElement()))
+ Type type = attribs[i].getType();
+ boolean isPointerType = false;
+ if (type.isSimpleType())
+ {
+ isPointerType = CUtils.isPointerType(CUtils.getclass4qname(type.getBaseType()));
+ }
+ else
+ {
+ isPointerType = CUtils.isPointerType(attribs[i].getTypeName());
+ }
+ if ((attribs[i].isSimpleType() || attribs[i].getType().isSimpleType()) && (isPointerType || attribs[i].isOptional() || attribs[i].isNillable() || attribs[i].getChoiceElement() || attribs[i].getAllElement()))
{
writer.write("\t" + attribs[i].getParamName() + " = NULL;\n");
writer.write("\t__axis_deepcopy_" + attribs[i].getParamName() + " = false;\n");
@@ -1376,7 +1455,7 @@
writer.write("\t" + attribs[i].getParamNameAsMember() + "->clear();\n");
}
}
- else if (!attribs[i].isSimpleType())
+ else if (!(attribs[i].isSimpleType() || attribs[i].getType().isSimpleType()))
{
if (attribs[i].isAnyType())
{
@@ -1398,7 +1477,17 @@
}
else
{
- if(CUtils.isPointerType(attribs[i].getTypeName()))
+ Type type = attribs[i].getType();
+ boolean isPointerType = false;
+ if (type.isSimpleType())
+ {
+ isPointerType = CUtils.isPointerType(CUtils.getclass4qname(type.getBaseType()));
+ }
+ else
+ {
+ isPointerType = CUtils.isPointerType(attribs[i].getTypeName());
+ }
+ if(isPointerType)
{
writer.write("\t"+ attribs[i].getParamNameAsMember() + " = NULL;\n");
writer.write("\t__axis_deepcopy_" + attribs[i].getParamName() + " = false;\n");
@@ -1439,6 +1528,18 @@
{
String name = attribs[i].getParamNameAsMember();
String typename = attribs[i].getTypeName();
+
+ Type type = attribs[i].getType();
+ boolean isPointerType = false;
+ if (type.isSimpleType())
+ {
+ isPointerType = CUtils.isPointerType(CUtils.getclass4qname(type.getBaseType()));
+ }
+ else
+ {
+ isPointerType = CUtils.isPointerType(typename);
+ }
+
if(attribs[i].isArray())
{
writer.write("\tif (" + name + "!= NULL)\n");
@@ -1459,7 +1560,7 @@
writer.write("\t}\n");
}
- else if (!attribs[i].isSimpleType())
+ else if (!(attribs[i].isSimpleType() || attribs[i].getType().isSimpleType()))
{
writer.write("\tif (" + name + "!= NULL)\n");
writer.write("\t{\n");
@@ -1467,7 +1568,7 @@
writer.write("\t\t" + name + " = NULL;\n");
writer.write("\t}\n");
}
- else if (CUtils.isPointerType(typename) || isElementNillable(i) || isElementOptional(i) || attribs[i].getChoiceElement() || attribs[i].getAllElement())
+ else if (isPointerType || isElementNillable(i) || isElementOptional(i) || attribs[i].getChoiceElement() || attribs[i].getAllElement())
{
// found pointer type
writer.write("\tif (" + name + " != NULL)\n");
@@ -1475,7 +1576,7 @@
writer.write("\t\tif(__axis_deepcopy_" + name + ")\n");
writer.write("\t\t{\n");
writer.write("\t\t\tdelete ");
- if (CUtils.isPointerType(typename))
+ if (isPointerType)
{
writer.write("[] ");
}
@@ -1645,41 +1746,5 @@
}
return moreThanOne;
- }
-
- // FJP Nillable vv
- protected boolean isElementNillable(int index)
- {
- //ElementInfo ei = type.getElementForElementName(attribs[index].getParamName());
- boolean bNillable = false;
-
- if (//ei != null
- // &&
- attribs[index].isSimpleType()
- && !attribs[index].isArray()
- && !CUtils.isPointerType(attribs[index].getTypeName()) )
- {
- bNillable = attribs[index].isNillable();
- }
-
- return bNillable;
- }
- // FJP Nillable ^^
-
- protected boolean isElementOptional(int index)
- {
- //ElementInfo ei = type.getElementForElementName(attribs[index].getParamName());
- boolean bOptional = false;
-
- if (//ei != null
- // &&
- attribs[index].isSimpleType()
- && !attribs[index].isArray()
- && !CUtils.isPointerType(attribs[index].getTypeName()) )
- {
- bOptional = attribs[index].isOptional();
- }
-
- return bOptional;
}
}
Modified: webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/ParmHeaderFileWriter.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/ParmHeaderFileWriter.java?rev=372203&r1=372202&r2=372203&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/ParmHeaderFileWriter.java (original)
+++ webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/ParmHeaderFileWriter.java Wed Jan 25 05:16:12 2006
@@ -123,7 +123,17 @@
boolean foundDeepCopyType = false;
for (int i = 0 ; i < attribs.length ; i++)
{
- if (attribs[i].isSimpleType() && !attribs[i].isArray() &&(isElementNillable(i) || isElementOptional(i) || CUtils.isPointerType(getCorrectParmNameConsideringArraysAndComplexTypes(attribs[i])) || attribs[i].getChoiceElement() || attribs[i].getAllElement()))
+ Type type = attribs[i].getType();
+ boolean isPointerType = false;
+ if (type.isSimpleType())
+ {
+ isPointerType = CUtils.isPointerType(CUtils.getclass4qname(type.getBaseType()));
+ }
+ else
+ {
+ isPointerType = CUtils.isPointerType(getCorrectParmNameConsideringArraysAndComplexTypes(attribs[i]));
+ }
+ if ((attribs[i].isSimpleType() || attribs[i].getType().isSimpleType()) && !attribs[i].isArray() &&(isElementNillable(i) || isElementOptional(i) || isPointerType || attribs[i].getChoiceElement() || attribs[i].getAllElement()))
{
if (!foundDeepCopyType)
{
@@ -161,8 +171,7 @@
}
String langTypeName = CUtils.getclass4qname(baseType);
writer.write("typedef ");
- if ("string".equals(baseType.getLocalPart())
- || "NMTOKEN".equals(baseType.getLocalPart()))
+ if (CUtils.isPointerType(CUtils.getclass4qname(baseType)) || "xsd__base64Binary".equals(CUtils.getclass4qname(baseType)) || "xsd__hexBinary".equals(CUtils.getclass4qname(baseType)))
{
writer.write(langTypeName + " " + classname + ";\n");
writer.write("typedef " + langTypeName + "_Array " + classname
@@ -322,8 +331,16 @@
{
paramName += " *";
}
- writer.write("\tclass "
- + paramName
+
+ if (!attribs[i].isSimpleType() && attribs[i].getType().isSimpleType())
+ {
+ writer.write("\t");
+ }
+ else
+ {
+ writer.write("\tclass ");
+ }
+ writer.write(paramName
+ " " + attribs[i].getParamName()
+ ";\n");
@@ -562,7 +579,18 @@
+ "("
+ getCorrectParmNameConsideringArraysAndComplexTypes(attribs[i])
+ " InValue");
- if ( (attribs[i].getAllElement() || attribs[i].getChoiceElement() || CUtils.isPointerType(getCorrectParmNameConsideringArraysAndComplexTypes(attribs[i]))) && attribs[i].isSimpleType())
+ Type type = attribs[i].getType();
+ boolean isPointerType = false;
+ if (type.isSimpleType())
+ {
+ isPointerType = CUtils.isPointerType(CUtils.getclass4qname(type.getBaseType()));
+ }
+ else
+ {
+ isPointerType = CUtils.isPointerType(getCorrectParmNameConsideringArraysAndComplexTypes(attribs[i]));
+ }
+
+ if ( (attribs[i].getAllElement() || attribs[i].getChoiceElement() || isPointerType) && (attribs[i].isSimpleType() || attribs[i].getType().isSimpleType()))
{
writer.write(", bool deep = true");
}
@@ -666,7 +694,7 @@
HashSet typeSet = new HashSet();
for (int i = 0; i < attribs.length; i++)
{
- if ((attribs[i].isArray()) && (!attribs[i].isSimpleType()))
+ if ((attribs[i].isArray()) && !(attribs[i].isSimpleType() || attribs[i].getType().isSimpleType()))
{
typeSet.add(attribs[i].getTypeName() + "_Array");
}
@@ -694,7 +722,7 @@
typeSet = new HashSet();
for (int i = 0; i < attribs.length; i++)
{
- if (!attribs[i].isArray() && !attribs[i].isSimpleType()
+ if (!attribs[i].isArray() && !(attribs[i].isSimpleType() || attribs[i].getType().isSimpleType())
&& !attribs[i].isAnyType())
{
typeSet.add(attribs[i].getTypeName());
@@ -715,34 +743,5 @@
protected String getFileType()
{
return "Param";
- }
-
- // FJP Nillable vv
- protected boolean isElementNillable(int index)
- {
- boolean bNillable = false;
-
- if (attribs[index].isSimpleType()
- && !attribs[index].isArray()
- && !CUtils.isPointerType(attribs[index].getTypeName()))
- {
- bNillable = attribs[index].isNillable();
- }
-
- return bNillable;
- }
- // FJP Nillable ^^
- protected boolean isElementOptional(int index)
- {
- boolean bOptional = false;
-
- if (attribs[index].isSimpleType()
- && !attribs[index].isArray()
- && !CUtils.isPointerType(attribs[index].getTypeName()))
- {
- bOptional = attribs[index].isOptional();
- }
-
- return bOptional;
}
}
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=372203&r1=372202&r2=372203&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 Wed Jan 25 05:16:12 2006
@@ -18,6 +18,8 @@
#include <iostream>
#include <fstream>
+using namespace std;
+
#define WSDL_DEFAULT_ENDPOINT "http://localhost:9080/SimpleTypeInnerUnbounded/services/sampleWS"
// Prototype