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 2008/08/19 06:05:13 UTC
svn commit: r686955 [4/4] - in
/webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws: ./ c/
c/literal/ cpp/ cpp/literal/ info/
Modified: webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/ClientStubWriter.java
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/ClientStubWriter.java?rev=686955&r1=686954&r2=686955&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/ClientStubWriter.java (original)
+++ webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/ClientStubWriter.java Mon Aug 18 21:05:12 2008
@@ -41,7 +41,6 @@
import org.apache.axis.wsdl.wsdl2ws.CUtils;
import org.apache.axis.wsdl.wsdl2ws.WrapperConstants;
import org.apache.axis.wsdl.wsdl2ws.WrapperFault;
-import org.apache.axis.wsdl.wsdl2ws.WrapperUtils;
import org.apache.axis.wsdl.wsdl2ws.info.MethodInfo;
import org.apache.axis.wsdl.wsdl2ws.info.ParameterInfo;
import org.apache.axis.wsdl.wsdl2ws.info.Type;
@@ -97,7 +96,7 @@
retType = wscontext.getTypemap().getType(returntype.getSchemaName());
if (retType != null)
{
- outparamType = WrapperUtils.getClassNameFromParamInfoConsideringArrays(returntype, wscontext);
+ outparamType = CUtils.getClassNameFromParamInfoConsideringArrays(returntype, wscontext);
if (retType.isSimpleType())
returntypeissimple = true;
else
@@ -150,14 +149,14 @@
{
if (type.isSimpleType ())
{
- baseTypeName = CUtils.getclass4qname (type.getBaseType ());
- paramTypeName = WrapperUtils.getClassNameFromParamInfoConsideringArrays(paramtype, wscontext);
+ baseTypeName = CUtils.getBasicTypeForQName (type.getBaseType ());
+ paramTypeName = CUtils.getClassNameFromParamInfoConsideringArrays(paramtype, wscontext);
}
else
{
paramTypeName = type.getLanguageSpecificName ();
if (CUtils.isSimpleType (paramTypeName))
- paramTypeName = WrapperUtils.getClassNameFromParamInfoConsideringArrays(paramtype, wscontext);
+ paramTypeName = CUtils.getClassNameFromParamInfoConsideringArrays(paramtype, wscontext);
typeisarray = (paramTypeName.lastIndexOf ("_Array") > 0);
if (!typeisarray)
@@ -200,14 +199,14 @@
{
if (type.isSimpleType ())
{ //schema defined simpleType
- baseTypeName = CUtils.getclass4qname (type.getBaseType ());
- paramTypeName = WrapperUtils.getClassNameFromParamInfoConsideringArrays(paramtype, wscontext);
+ baseTypeName = CUtils.getBasicTypeForQName (type.getBaseType ());
+ paramTypeName = CUtils.getClassNameFromParamInfoConsideringArrays(paramtype, wscontext);
}
else
{
paramTypeName = type.getLanguageSpecificName ();
if (CUtils.isSimpleType (paramTypeName))
- paramTypeName = WrapperUtils.getClassNameFromParamInfoConsideringArrays(paramtype, wscontext);
+ paramTypeName = CUtils.getClassNameFromParamInfoConsideringArrays(paramtype, wscontext);
typeisarray = (paramTypeName.lastIndexOf ("_Array") > 0);
if (!typeisarray)
@@ -251,9 +250,9 @@
type = wscontext.getTypemap ().getType (((ParameterInfo) paramsC.get (i)).getSchemaName ());
ParameterInfo param = (ParameterInfo) paramsC.get (i);
- String paramType = WrapperUtils.getClassNameFromParamInfoConsideringArrays (param, wscontext);
+ String paramType = CUtils.getClassNameFromParamInfoConsideringArrays (param, wscontext);
if (type.isSimpleType())
- baseTypeName = CUtils.getclass4qname(type.getBaseType());
+ baseTypeName = CUtils.getBasicTypeForQName(type.getBaseType());
else
baseTypeName = paramType;
@@ -308,7 +307,7 @@
writer.write (outparamType + "* Ret = NULL;\n");
else
{
- String initValue = CUtils.getInitValue (outparamType);
+ String initValue = CUtils.getInitValueForBasicType (outparamType);
if (initValue != null)
writer.write (outparamType + " Ret = " + initValue + ";\n");
else if (CUtils.getXSDTypeForBasicType( outparamType).equals("XSD_DATETIME")
@@ -411,12 +410,12 @@
if (type != null)
{
if (type.isSimpleType ())
- paramTypeName = CUtils.getclass4qname (type.getBaseType ());
+ paramTypeName = CUtils.getBasicTypeForQName (type.getBaseType ());
else
{
paramTypeName = type.getLanguageSpecificName ();
if (CUtils.isSimpleType (paramTypeName))
- paramTypeName = WrapperUtils.getClassNameFromParamInfoConsideringArrays(param,wscontext);
+ paramTypeName = CUtils.getClassNameFromParamInfoConsideringArrays(param,wscontext);
typeisarray = (paramTypeName.lastIndexOf ("_Array") > 0);
if (!typeisarray)
@@ -482,7 +481,7 @@
}
else if (typeisarray)
{
- Type arrayType = WrapperUtils.getArrayType (type);
+ Type arrayType = CUtils.getArrayType (type);
QName qname = null;
if (arrayType != null)
@@ -493,14 +492,14 @@
if (CUtils.isSimpleType (qname))
{
// Array of simple type
- String containedType = CUtils.getclass4qname (qname);
+ String containedType = CUtils.getBasicTypeForQName (qname);
writer.write (tab2 + "\t\tm_pCall->addBasicArrayParameter(");
writer.write ("Value" + i + ", " +
CUtils.getXSDTypeForBasicType(containedType) + ", cPrefixAndParamName" + i);
}
else if (arrayType != null && arrayType.isSimpleType ())
{
- String containedType = CUtils.getclass4qname (arrayType.getBaseType ());
+ String containedType = CUtils.getBasicTypeForQName (arrayType.getBaseType ());
writer.write (tab2 + "\t\tm_pCall->addBasicArrayParameter(");
writer.write ("Value" + i + ", " +
CUtils.getXSDTypeForBasicType(containedType) +
@@ -613,12 +612,12 @@
{
if (type.isSimpleType ())
{
- baseTypeName = CUtils.getclass4qname (type.getBaseType ());
- currentParaType = WrapperUtils.getClassNameFromParamInfoConsideringArrays(currentType, wscontext);
+ baseTypeName = CUtils.getBasicTypeForQName (type.getBaseType ());
+ currentParaType = CUtils.getClassNameFromParamInfoConsideringArrays(currentType, wscontext);
}
else
{
- currentParaType = WrapperUtils.getClassNameFromParamInfoConsideringArrays(currentType, wscontext);
+ currentParaType = CUtils.getClassNameFromParamInfoConsideringArrays(currentType, wscontext);
typeisarray = (currentParaType.lastIndexOf("_Array") > 0);
}
@@ -640,8 +639,8 @@
if (typeisarray)
{
QName qname = null;
- if (WrapperUtils.getArrayType (type) != null)
- qname = WrapperUtils.getArrayType (type).getName ();
+ if (CUtils.getArrayType (type) != null)
+ qname = CUtils.getArrayType (type).getName ();
else
qname = type.getName ();
@@ -649,7 +648,7 @@
if (CUtils.isSimpleType (qname))
{
- containedType = CUtils.getclass4qname (qname);
+ containedType = CUtils.getBasicTypeForQName (qname);
writer.write("\n\t\t\t\tAxis_Array * pReturn" + i + " = m_pCall->getBasicArray(" + CUtils.getXSDTypeForBasicType (containedType)
+ ", \"" + currentType.getParamNameAsSOAPString ()
@@ -702,7 +701,7 @@
if (CUtils.isPointerType(baseTypeName))
{
- String xsdType = WrapperUtils.getClassNameFromParamInfoConsideringArrays ((ParameterInfo) paramsC.get (i), wscontext);
+ String xsdType = CUtils.getClassNameFromParamInfoConsideringArrays ((ParameterInfo) paramsC.get (i), wscontext);
if( !CUtils.isPointerType(baseTypeName))
{
@@ -712,7 +711,7 @@
xsdType += " *";
}
- writer.write( "\t\t\t\t" + currentParaType + " pReturn" + i + " = m_pCall->" + CUtils.getParameterGetValueMethodName( baseTypeName, false) + "( \"" + currentType.getParamNameAsSOAPString() + "\", 0);\n");
+ writer.write( "\t\t\t\t" + currentParaType + " pReturn" + i + " = m_pCall->" + CUtils.getDeserializerMethodNameForType( baseTypeName, false) + "( \"" + currentType.getParamNameAsSOAPString() + "\", 0);\n");
writer.write( "\n");
writer.write( "\t\t\t\tif( pReturn" + i + " != NULL && OutValue" + i + " != NULL)\n");
writer.write( "\t\t\t\t\t{\n");
@@ -740,7 +739,7 @@
}
else
{
- writer.write( "\t\t\t\t" + currentParaType + " * pReturn" + i + " = m_pCall->" + CUtils.getParameterGetValueMethodName( baseTypeName, false) + "( \"" + currentType.getParamNameAsSOAPString() + "\", 0);\n");
+ writer.write( "\t\t\t\t" + currentParaType + " * pReturn" + i + " = m_pCall->" + CUtils.getDeserializerMethodNameForType( baseTypeName, false) + "( \"" + currentType.getParamNameAsSOAPString() + "\", 0);\n");
writer.write( "\n");
writer.write( "\t\t\t\tif( pReturn" + i + " != NULL && OutValue" + i + " != NULL)\n");
writer.write( "\t\t\t\t{\n");
@@ -792,14 +791,14 @@
else if (returntypeisarray)
{
QName qname = null;
- if (WrapperUtils.getArrayType (retType) != null)
- qname = WrapperUtils.getArrayType (retType).getName ();
+ if (CUtils.getArrayType (retType) != null)
+ qname = CUtils.getArrayType (retType).getName ();
else
qname = retType.getName ();
String containedType = null;
if (CUtils.isSimpleType (qname))
{
- containedType = CUtils.getclass4qname (qname);
+ containedType = CUtils.getBasicTypeForQName (qname);
writer.write ("\t\t\t\tAxis_Array * RetAxisArray = m_pCall->getBasicArray("
+ CUtils.getXSDTypeForBasicType (containedType)
+ ", \"" + returntype.getParamNameAsSOAPString () + "\", 0);\n");
@@ -826,13 +825,13 @@
if (returntype.isNillable () || returntype.isOptional() || CUtils.isPointerType(outparamType))
{
writer.write( "\t\t\t\tRet = m_pCall->"
- + CUtils.getParameterGetValueMethodName( outparamType, false)
+ + CUtils.getDeserializerMethodNameForType( outparamType, false)
+ "(\"" + returntype.getParamNameAsSOAPString() + "\", 0);\n");
}
else
{
writer.write ("\t\t\t\t" + outparamType + " * pReturn = m_pCall->" +
- CUtils.getParameterGetValueMethodName(outparamType, false) + "(\"" +
+ CUtils.getDeserializerMethodNameForType(outparamType, false) + "(\"" +
returntype.getElementNameAsSOAPString() + "\", 0);\n");
writer.write ("\t\t\t\tif(pReturn)\n");
writer.write ("\t\t\t\t{\n");
Modified: webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/WrapWriter.java
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/WrapWriter.java?rev=686955&r1=686954&r2=686955&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/WrapWriter.java (original)
+++ webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/WrapWriter.java Mon Aug 18 21:05:12 2008
@@ -31,7 +31,6 @@
import org.apache.axis.wsdl.wsdl2ws.CUtils;
import org.apache.axis.wsdl.wsdl2ws.WrapperFault;
-import org.apache.axis.wsdl.wsdl2ws.WrapperUtils;
import org.apache.axis.wsdl.wsdl2ws.info.FaultInfo;
import org.apache.axis.wsdl.wsdl2ws.info.MethodInfo;
import org.apache.axis.wsdl.wsdl2ws.info.ParameterInfo;
@@ -83,14 +82,14 @@
if (retType.isSimpleType())
{
returntypeissimple = true;
- outparamType = CUtils.getclass4qname(retType.getBaseType());
+ outparamType = CUtils.getBasicTypeForQName(retType.getBaseType());
}
else if (returntype.isArray())
{
- outparamType = WrapperUtils.getClassNameFromParamInfoConsideringArrays(returntype,wscontext);
+ outparamType = CUtils.getClassNameFromParamInfoConsideringArrays(returntype,wscontext);
returntypeissimple =
- (null != CUtils.getclass4qname(retType.getName())
- && CUtils.isSimpleType(CUtils.getclass4qname(retType.getName())));
+ (null != CUtils.getBasicTypeForQName(retType.getName())
+ && CUtils.isSimpleType(CUtils.getBasicTypeForQName(retType.getName())));
returntypeisarray = true;
}
else
@@ -148,9 +147,9 @@
type = this.wscontext.getTypemap().getType(param.getSchemaName());
if (type != null && type.isSimpleType())
- paraTypeName = CUtils.getclass4qname(type.getBaseType());
+ paraTypeName = CUtils.getBasicTypeForQName(type.getBaseType());
else if (param.isArray())
- paraTypeName = WrapperUtils.getClassNameFromParamInfoConsideringArrays(param,wscontext);
+ paraTypeName = CUtils.getClassNameFromParamInfoConsideringArrays(param,wscontext);
else
paraTypeName = param.getLangName();
@@ -169,7 +168,7 @@
}
writer.write("\t" + paraTypeName + splatPtr + "v" + i + " =" + splatDeref
- + "(pIWSDZ->" + CUtils.getParameterGetValueMethodName(paraTypeName,false)
+ + "(pIWSDZ->" + CUtils.getDeserializerMethodNameForType(paraTypeName,false)
+ "(\"" + elementName + "\",0));\n");
}
else if ((CUtils.isSimpleType(param.getLangName())))
@@ -177,7 +176,7 @@
//for simple types
if (param.isArray())
{
- String containedType = CUtils.getclass4qname(type.getName());
+ String containedType = CUtils.getBasicTypeForQName(type.getName());
writer.write("\n\t" + containedType + "_Array * v" + i +" = new " + containedType + "_Array();\n");
writer.write("\t"
@@ -197,7 +196,7 @@
writer.write("\t{\n");
}
writer.write("\t" + paraTypeName + " value" + i + " = pIWSDZ->"
- + CUtils.getParameterGetValueMethodName(paraTypeName,false)
+ + CUtils.getDeserializerMethodNameForType(paraTypeName,false)
+ "(\"" + elementName + "\",0);\n");
writer.write("\tif ( value" + i + " )\n");
writer.write("\t{\n");
@@ -218,7 +217,7 @@
writer.write("\t{\n");
}
writer.write("\t" + paraTypeName + " * pValue" + i + " = pIWSDZ->"
- + CUtils.getParameterGetValueMethodName(paraTypeName,false)
+ + CUtils.getDeserializerMethodNameForType(paraTypeName,false)
+ "(\"" + elementName + "\",0);\n");
writer.write("\tif (pValue" + i +")\n");
writer.write("\t{\n");
@@ -232,14 +231,14 @@
else
{
writer.write("\n\t" + paraTypeName + " v" + i);
- String typeInitValue = CUtils.getInitValue(paraTypeName);
+ String typeInitValue = CUtils.getInitValueForBasicType(paraTypeName);
if (typeInitValue != null)
writer.write(" = " + typeInitValue);
writer.write(";\n");
writer.write("\t"
+ paraTypeName + " * pValue" + i + " = pIWSDZ->"
- + CUtils.getParameterGetValueMethodName(paraTypeName,false) + "(\""
+ + CUtils.getDeserializerMethodNameForType(paraTypeName,false) + "(\""
+ elementName + "\", 0);\n");
writer.write("\tif (pValue" + i + ")\n");
writer.write("\t{\n");
@@ -251,12 +250,12 @@
}
else if ((type != null) && type.isArray())
{
- Type arrayType = WrapperUtils.getArrayType(type);
+ Type arrayType = CUtils.getArrayType(type);
QName qname = arrayType.getName();
String containedType = null;
if (CUtils.isSimpleType(qname))
{
- containedType = CUtils.getclass4qname(qname);
+ containedType = CUtils.getBasicTypeForQName(qname);
writer.write("\n\t" + outparamType + "_Array * v" + i +" = new " + outparamType + "_Array();\n");
writer.write("\t"
+ "Axis_Array * RetArray" + i + " = pIWSDZ->getBasicArray("
@@ -267,7 +266,7 @@
}
else if (arrayType.isSimpleType())
{
- containedType = CUtils.getclass4qname(arrayType.getBaseType());
+ containedType = CUtils.getBasicTypeForQName(arrayType.getBaseType());
writer.write("\n\t" + outparamType + " * v" + i +" = new " + outparamType + "();\n");
writer.write("\t"
+ "Axis_Array * RetArray" + i + " = pIWSDZ->getBasicArray("
@@ -314,7 +313,7 @@
for (int i = 0; i < paramsC.size(); i++)
{
ParameterInfo param = (ParameterInfo) paramsC.get(i);
- String typeName = WrapperUtils.getClassNameFromParamInfoConsideringArrays(
+ String typeName = CUtils.getClassNameFromParamInfoConsideringArrays(
(ParameterInfo) paramsC.get(i), wscontext);
writer.write("\t" + typeName);
@@ -355,7 +354,7 @@
{
if (returntype.isArray())
{
- String containedType = CUtils.getclass4qname(retType.getName());
+ String containedType = CUtils.getBasicTypeForQName(retType.getName());
writer.write("\t\tnStatus = pIWSSZ->addOutputBasicArrayParam(ret, "
+ CUtils.getXSDTypeForBasicType(containedType) + ", \""
+ returnParamName + "\");\n");
@@ -381,12 +380,12 @@
}
else if (returntypeisarray)
{
- Type arrayType = WrapperUtils.getArrayType(retType);
+ Type arrayType = CUtils.getArrayType(retType);
QName qname = arrayType.getName();
String containedType = null;
if (CUtils.isSimpleType(qname))
{
- containedType = CUtils.getclass4qname(qname);
+ containedType = CUtils.getBasicTypeForQName(qname);
writer.write("\t\tnStatus = pIWSSZ->addOutputBasicArrayParam(ret, "
+ CUtils.getXSDTypeForBasicType(containedType)
+ ", \"" + returnParamName + "\");\n");
@@ -395,7 +394,7 @@
}
else if (arrayType.isSimpleType())
{
- containedType = CUtils.getclass4qname(arrayType.getBaseType());
+ containedType = CUtils.getBasicTypeForQName(arrayType.getBaseType());
writer.write("\t\tnStatus = pIWSSZ->addOutputBasicArrayParam(ret, "
+ CUtils.getXSDTypeForBasicType(containedType)
+ ", \"" + returnParamName + "\");\n");
@@ -449,7 +448,7 @@
{
returntypeissimple = true;
outparamType =
- CUtils.getclass4qname(retType.getBaseType());
+ CUtils.getBasicTypeForQName(retType.getBaseType());
}
else
{
@@ -471,7 +470,7 @@
{
if (param.isArray())
{
- String containedType = CUtils.getclass4qname(retType.getName());
+ String containedType = CUtils.getBasicTypeForQName(retType.getName());
writer.write("\treturn pIWSSZ->addOutputBasicArrayParam((Axis_Array*)(&out" + i + "),"
+ CUtils.getXSDTypeForBasicType(containedType)
+ ", \"" + returnParamName + "\");\n");
@@ -505,20 +504,20 @@
}
else if (returntypeisarray)
{
- Type arrayType = WrapperUtils.getArrayType(retType);
+ Type arrayType = CUtils.getArrayType(retType);
QName qname = arrayType.getName();
String containedType = null;
if (CUtils.isSimpleType(qname))
{
- containedType = CUtils.getclass4qname(qname);
+ containedType = CUtils.getBasicTypeForQName(qname);
writer.write("\tpIWSSZ->addOutputBasicArrayParam((Axis_Array*)(&out"
+ i + ")," + CUtils.getXSDTypeForBasicType( containedType)
+ ", \"" + returnParamName + "\");\n");
}
else if (arrayType.isSimpleType())
{
- containedType = CUtils.getclass4qname(arrayType.getBaseType());
+ containedType = CUtils.getBasicTypeForQName(arrayType.getBaseType());
writer.write("\tpIWSSZ->addOutputBasicArrayParam((Axis_Array*)(&out"
+ i + ")," + CUtils.getXSDTypeForBasicType(containedType)
+ ", \"" + returnParamName + "\");\n");
@@ -586,7 +585,7 @@
ParameterInfo par = (ParameterInfo) paramInfo.get(i);
paramName = par.getParamName();
langName = par.getLangName();
- faultType = WrapperUtils.getClassNameFromParamInfoConsideringArrays(par,wscontext);
+ faultType = CUtils.getClassNameFromParamInfoConsideringArrays(par,wscontext);
writeExceptions(faultType, faultInfoName, paramName, langName);
}
}
Modified: webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/info/ParameterInfo.java
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/info/ParameterInfo.java?rev=686955&r1=686954&r2=686955&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/info/ParameterInfo.java (original)
+++ webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/info/ParameterInfo.java Mon Aug 18 21:05:12 2008
@@ -144,7 +144,7 @@
attribNameAsMember = CUtils.sanitizeString(attribName);
methodName = attribNameAsMember;
- if (typeMap != null && CUtils.classExists(typeMap, attribNameAsMember))
+ if (typeMap != null && typeMap.doesTypeExist(attribNameAsMember))
attribNameAsMember += "_Ref";
attribNameAsMember = CUtils.resolveWSDL2LanguageNameClashes(attribNameAsMember);
}
Modified: webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/info/Type.java
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/info/Type.java?rev=686955&r1=686954&r2=686955&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/info/Type.java (original)
+++ webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/info/Type.java Mon Aug 18 21:05:12 2008
@@ -78,9 +78,6 @@
/* whether the type is Array */
private boolean isArray;
-
- /* C or CPP */
- private String language;
/* element type */
private String elementType;
@@ -114,28 +111,16 @@
// is type the input type for unwrapped doc/lit operation?
private boolean isUnwrappedInputType = false;
- public Type(QName name, String languageSpecificName, String language)
+ public Type(QName name, String languageSpecificName)
{
this.languageSpecificName = languageSpecificName;
this.name = name;
elements = new Hashtable();
vElements = new Vector();
-
- if (language == null)
- this.language = WrapperConstants.LANGUAGE_CPP;
- else
- this.language = language;
// if the language specific name is not specified try a simple type
if (languageSpecificName == null)
- {
- if (WrapperConstants.LANGUAGE_CPP.equalsIgnoreCase(this.language))
- this.languageSpecificName = CUtils.getclass4qname(name);
- else if (WrapperConstants.LANGUAGE_C.equalsIgnoreCase(this.language))
- this.languageSpecificName = CUtils.getclass4qname(name);
- else
- this.languageSpecificName = TypeMap.getBasicTypeClass4qname(name);
- }
+ this.languageSpecificName = CUtils.getBasicTypeForQName(name);
//if language specific name still not set, use localPart of QName
if (this.languageSpecificName == null)
Modified: webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/info/TypeMap.java
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/info/TypeMap.java?rev=686955&r1=686954&r2=686955&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/info/TypeMap.java (original)
+++ webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/info/TypeMap.java Mon Aug 18 21:05:12 2008
@@ -30,6 +30,7 @@
import java.util.Collection;
import java.util.Hashtable;
+import java.util.Iterator;
import javax.xml.namespace.QName;
@@ -40,8 +41,6 @@
public static final String ANON_TOKEN_STRING = ">";
public static final char ANON_TOKEN_CHAR = '>';
- private static String language = WrapperConstants.LANGUAGE_CPP;
-
/* this map maps the classname -> QName */
private static Hashtable basicTypeClass2QNamemap = new Hashtable();
@@ -49,7 +48,7 @@
private static Hashtable basicTypeQname2classmap = new Hashtable();
/* this map stores Types keyed by the parameter name */
- private Hashtable typeInfo;
+ private Hashtable typeInfo = new Hashtable();;
static {
// c -> xml type mapping
@@ -161,97 +160,38 @@
* Should be removed when the following issue will be fixed :
* -> http://marc.theaimsgroup.com/?t=107907748000002&r=1&w=2
*/
- basicTypeQname2classmap.put(
- new QName(WrapperConstants.SOAPENC_NAMESPACE, "integer"),
- "xsd__integer");
- basicTypeQname2classmap.put(
- new QName(WrapperConstants.SOAPENC_NAMESPACE, "string"),
- "xsd__string");
- basicTypeQname2classmap.put(
- new QName(WrapperConstants.SOAPENC_NAMESPACE, "decimal"),
- "xsd__decimal");
- basicTypeQname2classmap.put(
- new QName(WrapperConstants.SOAPENC_NAMESPACE, "QName"),
- "xsd__QName");
-/* basicTypeQname2classmap.put(
- new QName(WrapperConstants.SOAPENC_NAMESPACE, "NCName"),
- "xsd__NCName");
- */
- basicTypeQname2classmap.put(
- new QName(WrapperConstants.SOAPENC_NAMESPACE, "dateTime"),
- "xsd__dateTime");
- basicTypeQname2classmap.put(
- new QName(WrapperConstants.SOAPENC_NAMESPACE, "date"),
- "xsd__date");
- basicTypeQname2classmap.put(
- new QName(WrapperConstants.SOAPENC_NAMESPACE, "time"),
- "xsd__time");
- basicTypeQname2classmap.put(
- new QName(WrapperConstants.SOAPENC_NAMESPACE, "duration"),
- "xsd__duration");
- basicTypeQname2classmap.put(
- new QName(WrapperConstants.SOAPENC_NAMESPACE, "base64Binary"),
- "xsd__base64Binary");
- basicTypeQname2classmap.put(
- new QName(WrapperConstants.SOAPENC_NAMESPACE, "hexBinary"),
- "xsd__hexBinary");
- basicTypeQname2classmap.put(
- new QName(WrapperConstants.SOAPENC_NAMESPACE, "int"),
- "xsd__int");
- basicTypeQname2classmap.put(
- new QName(WrapperConstants.SOAPENC_NAMESPACE, "byte"),
- "xsd__byte");
- basicTypeQname2classmap.put(
- new QName(WrapperConstants.SOAPENC_NAMESPACE, "float"),
- "xsd__float");
- basicTypeQname2classmap.put(
- new QName(WrapperConstants.SOAPENC_NAMESPACE, "long"),
- "xsd__long");
- basicTypeQname2classmap.put(
- new QName(WrapperConstants.SOAPENC_NAMESPACE, "double"),
- "xsd__double");
- basicTypeQname2classmap.put(
- new QName(WrapperConstants.SOAPENC_NAMESPACE, "boolean"),
- "xsd__boolean");
- basicTypeQname2classmap.put(
- new QName(WrapperConstants.SOAPENC_NAMESPACE, "short"),
- "xsd__short");
- basicTypeQname2classmap.put(
- new QName(WrapperConstants.SOAPENC_NAMESPACE, "unsignedByte"),
- "xsd__unsignedByte");
- basicTypeQname2classmap.put(
- new QName(WrapperConstants.SOAPENC_NAMESPACE, "unsignedInt"),
- "xsd__unsignedInt");
- basicTypeQname2classmap.put(
- new QName(WrapperConstants.SOAPENC_NAMESPACE, "unsignedLong"),
- "xsd__unsignedLong");
- basicTypeQname2classmap.put(
- new QName(WrapperConstants.SOAPENC_NAMESPACE, "unsignedShort"),
- "xsd__unsignedShort");
- basicTypeQname2classmap.put(
- new QName(WrapperConstants.SOAPENC_NAMESPACE, "anyURI"),
- "xsd__anyURI");
- basicTypeQname2classmap.put(
- new QName(WrapperConstants.SOAPENC_NAMESPACE, "NMTOKEN"),
- "xsd__NMTOKEN");
+ basicTypeQname2classmap.put(new QName(WrapperConstants.SOAPENC_NAMESPACE, "integer"), "xsd__integer");
+ basicTypeQname2classmap.put(new QName(WrapperConstants.SOAPENC_NAMESPACE, "string"), "xsd__string");
+ basicTypeQname2classmap.put(new QName(WrapperConstants.SOAPENC_NAMESPACE, "decimal"), "xsd__decimal");
+ basicTypeQname2classmap.put(new QName(WrapperConstants.SOAPENC_NAMESPACE, "QName"), "xsd__QName");
+/* basicTypeQname2classmap.put(new QName(WrapperConstants.SOAPENC_NAMESPACE, "NCName"), "xsd__NCName"); */
+ basicTypeQname2classmap.put(new QName(WrapperConstants.SOAPENC_NAMESPACE, "dateTime"), "xsd__dateTime");
+ basicTypeQname2classmap.put(new QName(WrapperConstants.SOAPENC_NAMESPACE, "date"), "xsd__date");
+ basicTypeQname2classmap.put(new QName(WrapperConstants.SOAPENC_NAMESPACE, "time"), "xsd__time");
+ basicTypeQname2classmap.put(new QName(WrapperConstants.SOAPENC_NAMESPACE, "duration"), "xsd__duration");
+ basicTypeQname2classmap.put(new QName(WrapperConstants.SOAPENC_NAMESPACE, "base64Binary"), "xsd__base64Binary");
+ basicTypeQname2classmap.put(new QName(WrapperConstants.SOAPENC_NAMESPACE, "hexBinary"), "xsd__hexBinary");
+ basicTypeQname2classmap.put(new QName(WrapperConstants.SOAPENC_NAMESPACE, "int"), "xsd__int");
+ basicTypeQname2classmap.put(new QName(WrapperConstants.SOAPENC_NAMESPACE, "byte"), "xsd__byte");
+ basicTypeQname2classmap.put(new QName(WrapperConstants.SOAPENC_NAMESPACE, "float"), "xsd__float");
+ basicTypeQname2classmap.put(new QName(WrapperConstants.SOAPENC_NAMESPACE, "long"), "xsd__long");
+ basicTypeQname2classmap.put(new QName(WrapperConstants.SOAPENC_NAMESPACE, "double"), "xsd__double");
+ basicTypeQname2classmap.put(new QName(WrapperConstants.SOAPENC_NAMESPACE, "boolean"), "xsd__boolean");
+ basicTypeQname2classmap.put(new QName(WrapperConstants.SOAPENC_NAMESPACE, "short"), "xsd__short");
+ basicTypeQname2classmap.put(new QName(WrapperConstants.SOAPENC_NAMESPACE, "unsignedByte"), "xsd__unsignedByte");
+ basicTypeQname2classmap.put(new QName(WrapperConstants.SOAPENC_NAMESPACE, "unsignedInt"), "xsd__unsignedInt");
+ basicTypeQname2classmap.put(new QName(WrapperConstants.SOAPENC_NAMESPACE, "unsignedLong"), "xsd__unsignedLong");
+ basicTypeQname2classmap.put(new QName(WrapperConstants.SOAPENC_NAMESPACE, "unsignedShort"), "xsd__unsignedShort");
+ basicTypeQname2classmap.put(new QName(WrapperConstants.SOAPENC_NAMESPACE, "anyURI"), "xsd__anyURI");
+ basicTypeQname2classmap.put(new QName(WrapperConstants.SOAPENC_NAMESPACE, "NMTOKEN"), "xsd__NMTOKEN");
/* TODO:
* Another strange issue from Axis 1.1 runtime when base64binary is in input/output operations.
*/
- basicTypeQname2classmap.put(
- new QName(WrapperConstants.SOAPENC_NAMESPACE, "base64"),
- "xsd__base64Binary");
+ basicTypeQname2classmap.put(new QName(WrapperConstants.SOAPENC_NAMESPACE, "base64"), "xsd__base64Binary");
}
- public TypeMap(String language)
- {
- TypeMap.language = language;
- this.typeInfo = new Hashtable();
- }
-
- public static QName getBasicTypeQname4class(String classname)
+ public TypeMap()
{
- Object val = basicTypeClass2QNamemap.get(classname);
- return (QName) val;
}
public static String getBasicTypeClass4qname(QName qname)
@@ -260,11 +200,6 @@
return (String) val;
}
- public static boolean isSimpleType(String type)
- {
- return basicTypeClass2QNamemap.containsKey(type);
- }
-
public static boolean isSimpleType(QName type)
{
return basicTypeQname2classmap.containsKey(type);
@@ -273,7 +208,7 @@
public Type getType(QName name)
{
if (isSimpleType(name))
- return new Type(name, null, TypeMap.language);
+ return new Type(name, null);
return (Type) this.typeInfo.get(name);
}
@@ -293,6 +228,25 @@
return this.typeInfo.values();
}
+ public boolean doesTypeExist(String name)
+ {
+ Type atype;
+ String atypeName;
+ Iterator types = getTypes().iterator();
+ while (types.hasNext())
+ {
+ atype = (Type) types.next();
+ if (!atype.isExternalized())
+ continue;
+
+ atypeName = atype.getLanguageSpecificName();
+ if (null != atypeName && atypeName.equals( name ))
+ return true;
+ }
+
+ return false;
+ }
+
public static boolean isAnonymousType(String type)
{
if (type != null)
Modified: webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/info/WSDLInfo.java
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/info/WSDLInfo.java?rev=686955&r1=686954&r2=686955&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/info/WSDLInfo.java (original)
+++ webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/info/WSDLInfo.java Mon Aug 18 21:05:12 2008
@@ -32,14 +32,23 @@
import javax.wsdl.extensions.soap.SOAPBody;
import javax.wsdl.extensions.soap.SOAPOperation;
import javax.wsdl.extensions.soap.SOAPAddress;
+import javax.xml.namespace.QName;
+import javax.xml.rpc.holders.BooleanHolder;
import org.apache.axis.Constants;
import org.apache.axis.wsdl.gen.Parser;
import org.apache.axis.wsdl.symbolTable.BindingEntry;
+import org.apache.axis.wsdl.symbolTable.CSchemaUtils;
+import org.apache.axis.wsdl.symbolTable.SchemaUtils;
import org.apache.axis.wsdl.symbolTable.ServiceEntry;
import org.apache.axis.wsdl.symbolTable.SymTabEntry;
import org.apache.axis.wsdl.symbolTable.SymbolTable;
+import org.apache.axis.wsdl.symbolTable.TypeEntry;
+import org.apache.axis.wsdl.toJava.Utils;
+import org.apache.axis.wsdl.wsdl2ws.CUtils;
import org.apache.axis.wsdl.wsdl2ws.WrapperFault;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
/**
@@ -301,6 +310,211 @@
}
/**
+ * If the specified node represents a supported JAX-RPC restriction,
+ * a Vector is returned which contains the base type and the values (enumerations etc).
+ * The first element in the vector is the base type (an TypeEntry).
+ * Subsequent elements are QNames.
+ * NEEDS WORK - CURRENTLY THE ONLY THING WE DO IS GENERATE ENUMERATOR CONSTANTS AND CREATE
+ * AN EMPTY RESTRICTOR FUNCTION WHEN DOING CODE GENERATION STEP.
+ */
+ public void setRestrictionBaseAndValues(Type typedata, Node node)
+ {
+ if (node == null)
+ return;
+
+ // If the node kind is an element, dive into it.
+ QName nodeKind = Utils.getNodeQName(node);
+ if (nodeKind != null &&
+ nodeKind.getLocalPart().equals("element") &&
+ Constants.isSchemaXSD(nodeKind.getNamespaceURI()))
+ {
+ NodeList children = node.getChildNodes();
+ Node simpleNode = null;
+ for (int j = 0; j < children.getLength() && simpleNode == null; j++)
+ {
+ QName simpleKind = Utils.getNodeQName(children.item(j));
+ if (simpleKind != null &&
+ simpleKind.getLocalPart().equals("simpleType") &&
+ Constants.isSchemaXSD(simpleKind.getNamespaceURI()))
+ {
+ simpleNode = children.item(j);
+ node = simpleNode;
+ }
+ }
+ }
+
+ // Get the node kind, expecting a schema simpleType
+ nodeKind = Utils.getNodeQName(node);
+ if (nodeKind != null &&
+ nodeKind.getLocalPart().equals("simpleType") &&
+ Constants.isSchemaXSD(nodeKind.getNamespaceURI()))
+ {
+ // Under the simpleType there should be a restriction.
+ // (There may be other #text nodes, which we will ignore).
+ NodeList children = node.getChildNodes();
+ Node restrictionNode = null;
+ for (int j = 0; j < children.getLength() && restrictionNode == null; j++)
+ {
+ QName restrictionKind = Utils.getNodeQName(children.item(j));
+ if (restrictionKind != null &&
+ restrictionKind.getLocalPart().equals("restriction") &&
+ Constants.isSchemaXSD(restrictionKind.getNamespaceURI()))
+ restrictionNode = children.item(j);
+ }
+
+ // If no restriction node, just return
+ if (restrictionNode == null)
+ return;
+
+ // The restriction node indicates the type being restricted
+ // (the base attribute contains this type).
+ QName baseType = Utils.getTypeQName(restrictionNode, new BooleanHolder(), false);
+ TypeEntry baseEType = c_symbolTable.getType(baseType);
+
+ if (baseEType != null)
+ {
+ QName typedataQName = typedata.getName();
+ String typedataLocalpart = typedataQName.getLocalPart();
+ String baseTypeLocalpart = baseEType.getQName().getLocalPart();
+
+ QName typedataQNameSanitized = null;
+ String typedataLocalpartSanitized = null;
+ String baseTypeLocalpartSanitized = null;
+
+ Boolean isPointer = null;
+ String methodSuffix = null;
+
+ String primitiveXSDType = null;
+ String initValueForType = null;
+ String classForPrimitiveType = null;
+
+ if (TypeMap.isAnonymousType(typedataLocalpart))
+ {
+ typedataQNameSanitized = new QName(typedataQName.getNamespaceURI(), CUtils.sanitizeString(typedataLocalpart));
+ typedataLocalpartSanitized = CUtils.sanitizeString(typedataLocalpart);
+ }
+
+ if (TypeMap.isAnonymousType(baseTypeLocalpart))
+ baseTypeLocalpartSanitized = CUtils.sanitizeString(baseTypeLocalpart);
+
+ String class4qname = null;
+ String class4qnameSanitized = null;
+
+ String javaName = TypeMap.getBasicTypeClass4qname(baseEType.getQName());
+ boolean isBaseTypePrimitive = javaName != null;
+
+ QName primitiveBaseTypeQName = null;
+
+ if (javaName == null)
+ {
+ // No mapping - ensure that the base type is simple - if it is, then this
+ // must be a user-defined simple type that is based on another user-defined
+ // simple type.
+ if (!baseEType.isSimpleType()
+ && !SchemaUtils.isSimpleSchemaType(baseEType.getQName()))
+ return;
+
+ // Get the primitive base type
+ TypeEntry primitiveBaseType = CSchemaUtils.getBaseType(baseEType, c_symbolTable);
+ primitiveBaseTypeQName = primitiveBaseType.getQName();
+ }
+ else if (javaName.equals("boolean"))
+ return;
+ else
+ primitiveBaseTypeQName = baseEType.getQName();
+
+ classForPrimitiveType = CUtils.getBasicTypeForQName(primitiveBaseTypeQName);
+ initValueForType = CUtils.getInitValueForBasicType(classForPrimitiveType);
+
+ // Set the base type for Type
+ typedata.setBaseType(primitiveBaseTypeQName);
+
+ // We will map the user-defined type to the user-defined type, so set
+ // mapping for the type.
+ class4qname = typedataLocalpart;
+ class4qnameSanitized = typedataLocalpartSanitized;
+
+ // Update some commonly-used mapping tables to reflect the user-defined
+ // simple type. If anonymous type, we need to update mapping tables twice: once
+ // with the anonymous names, and once with the sanitized names.
+
+ isPointer = new Boolean(CUtils.isPointerType(primitiveBaseTypeQName));
+ primitiveXSDType = CUtils.getXSDTypeForBasicType(classForPrimitiveType);
+
+ if (!isBaseTypePrimitive)
+ {
+ typedata.setRestrictionBaseType(baseTypeLocalpart);
+ CUtils.c_isPointerBasedType.put(baseTypeLocalpart, isPointer);
+ }
+ CUtils.c_isPointerBasedType.put(typedataLocalpart, isPointer);
+
+ methodSuffix = (String)CUtils.c_basicTypeToMethodSuffixMapper.get(classForPrimitiveType);
+ CUtils.c_qnameToBasicTypeMapper.put(typedataQName, class4qname);
+ CUtils.c_basicTypeToEnumMapper.put(typedataLocalpart, primitiveXSDType);
+
+ if (initValueForType != null)
+ CUtils.c_initValueForBasicType.put(typedataLocalpart, initValueForType);
+ CUtils.c_basicTypeToMethodSuffixMapper.put(typedataLocalpart, methodSuffix);
+
+ if (!isBaseTypePrimitive)
+ {
+ CUtils.c_basicTypeToEnumMapper.put(baseTypeLocalpart, primitiveXSDType);
+ if (initValueForType != null)
+ CUtils.c_initValueForBasicType.put(baseTypeLocalpart, initValueForType);
+ CUtils.c_basicTypeToMethodSuffixMapper.put(baseTypeLocalpart, methodSuffix);
+ }
+
+ if (typedataQNameSanitized != null)
+ {
+ CUtils.c_isPointerBasedType.put(typedataLocalpartSanitized, isPointer);
+ CUtils.c_qnameToBasicTypeMapper.put(typedataQNameSanitized, class4qnameSanitized);
+ CUtils.c_basicTypeToEnumMapper.put(typedataLocalpartSanitized, primitiveXSDType);
+ if (initValueForType != null)
+ CUtils.c_initValueForBasicType.put(typedataLocalpartSanitized, initValueForType);
+ CUtils.c_basicTypeToMethodSuffixMapper.put(typedataLocalpartSanitized, methodSuffix);
+ }
+
+ if (baseTypeLocalpartSanitized != null)
+ {
+ CUtils.c_isPointerBasedType.put(baseTypeLocalpartSanitized, isPointer);
+ CUtils.c_basicTypeToEnumMapper.put(baseTypeLocalpartSanitized, primitiveXSDType);
+ if (initValueForType != null)
+ CUtils.c_initValueForBasicType.put(baseTypeLocalpartSanitized, initValueForType);
+ CUtils.c_basicTypeToMethodSuffixMapper.put(baseTypeLocalpartSanitized, methodSuffix);
+ }
+
+ // Process the enumeration elements underneath the restriction node
+ Vector v = new Vector();
+ NodeList enums = restrictionNode.getChildNodes();
+ for (int i=0; i < enums.getLength(); i++)
+ {
+ QName enumKind = Utils.getNodeQName(enums.item(i));
+ if (enumKind != null && Constants.isSchemaXSD(enumKind.getNamespaceURI()))
+ {
+ Node enumNode = enums.item(i);
+ String value = Utils.getAttribute(enumNode, "value");
+
+ if (value.indexOf(':')>0)
+ value=value.substring(value.indexOf(':')+1,value.length());
+ v.add(new QName(value, enumKind.getLocalPart()));
+ }
+ }
+
+ // The first element in the vector is a TypeEntry.
+ v.add(0,baseEType);
+ typedata.setRestrictiondata(v);
+ typedata.setRestriction(true);
+
+ // Add schema-defined simple type to mapping table - TODO: not sure we need this anymore.
+ CUtils.addSchemaDefinedSimpleType(typedataQName, class4qname);
+ if (typedataQNameSanitized != null)
+ CUtils.addSchemaDefinedSimpleType(typedataQNameSanitized, class4qnameSanitized);
+ }
+ }
+ return;
+ }
+
+ /**
* Returns list of Port objects in a service definition based on selection criteria.
*
* @param s service definition.