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 na...@apache.org on 2007/02/05 06:54:43 UTC
svn commit: r503560 [2/2] - in /webservices/axis/trunk/c:
src/wsdl/org/apache/axis/wsdl/symbolTable/
src/wsdl/org/apache/axis/wsdl/wsdl2ws/
src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/
src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/literal/ src/wsdl/org/apache/ax...
Modified: webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ClientStubWriter.java
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ClientStubWriter.java?view=diff&rev=503560&r1=503559&r2=503560
==============================================================================
--- webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ClientStubWriter.java (original)
+++ webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ClientStubWriter.java Sun Feb 4 21:54:41 2007
@@ -401,7 +401,7 @@
writer.write("Value" + i + ", "
+ CUtils.getXSDTypeForBasicType(containedType)
+ ", \""
- + ((ParameterInfo) paramsB.get(i)).getParamNameAsSOAPElement()
+ + ((ParameterInfo) paramsB.get(i)).getParamNameAsSOAPString()
+ "\"");
}
else
@@ -411,7 +411,7 @@
writer.write("Value" + i
+ ",(void *) Axis_Serialize_" + containedType
+ ",(void *) Axis_Delete_" + containedType
- + ",\"" + ((ParameterInfo) paramsB.get(i)).getParamNameAsSOAPElement() + "\""
+ + ",\"" + ((ParameterInfo) paramsB.get(i)).getParamNameAsSOAPString() + "\""
+ ",Axis_URI_" + containedType);
}
}
@@ -422,14 +422,14 @@
{
writer.write("\t\tm_pCall->addParameter( ");
writer.write("(void *) Value" + i + ", \""
- + ((ParameterInfo) paramsB.get(i)).getParamNameAsSOAPElement() + "\", "
+ + ((ParameterInfo) paramsB.get(i)).getParamNameAsSOAPString() + "\", "
+ CUtils.getXSDTypeForBasicType(paramTypeName));
}
else
{
writer.write("\t\tm_pCall->addParameter( ");
writer.write("(void *) &Value" + i + ", \""
- + ((ParameterInfo) paramsB.get(i)).getParamNameAsSOAPElement() + "\", "
+ + ((ParameterInfo) paramsB.get(i)).getParamNameAsSOAPString() + "\", "
+ CUtils.getXSDTypeForBasicType(paramTypeName));
}
}
@@ -440,7 +440,7 @@
writer.write("Value" + i
+ ",(void *) Axis_Serialize_" + paramTypeName
+ ",(void *) Axis_Delete_" + paramTypeName
- + ",\"" + ((ParameterInfo) paramsB.get(i)).getParamNameAsSOAPElement()
+ + ",\"" + ((ParameterInfo) paramsB.get(i)).getParamNameAsSOAPString()
+ "\",Axis_URI_" + paramTypeName);
}
@@ -451,16 +451,11 @@
+ minfo.getOutputMessage().getLocalPart() + "\",\""
+ namespaceURI
+ "\"))\n\t\t\t{\n");
-
- // Because getParamName will prefix any c++ reserved word with an
- // underscore (i.e 'return' becomes '_return'), this unnecessary
- // modification needs to be removed before using the name as a soap
- // tag identifier.
String paramTagName = "";
if( returntype != null)
- paramTagName = returntype.getParamNameAsSOAPElement();
+ paramTagName = returntype.getParamNameAsSOAPString();
if (isAllTreatedAsOutParams)
{
@@ -469,7 +464,7 @@
for (int i = 0; i < paramsC.size(); i++)
{
ParameterInfo currentType = (ParameterInfo) paramsC.get(i);
- paramTagName = currentType.getParamNameAsSOAPElement();
+ paramTagName = currentType.getParamNameAsSOAPString();
type = wscontext.getTypemap().getType(currentType.getSchemaName());
if (type != null)
@@ -520,7 +515,7 @@
+ ",(void *) Axis_DeSerialize_" + containedType
+ ",(void *) Axis_Create_" + containedType
+ ",(void *) Axis_Delete_" + containedType
- + ",\"" +currentType.getElementNameAsString()
+ + ",\"" +currentType.getElementNameAsSOAPString()
+ "\",Axis_URI_" + containedType + ");\n");
writer.write("\t\t\t}\n");
writer.write("\t\t\telse\n");
@@ -532,7 +527,7 @@
+ ",(void *) Axis_DeSerialize_" + containedType
+ ",(void *) Axis_Create_" + containedType
+ ",(void *) Axis_Delete_" + containedType
- + ",\"" + currentType.getElementNameAsString()
+ + ",\"" + currentType.getElementNameAsSOAPString()
+ "\",Axis_URI_" + containedType + ");\n");
writer.write("\t\t\t\tdelete pTemp" + i + ";\n");
writer.write("\t\t\t}\n");
Modified: webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ParamCPPFileWriter.java
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ParamCPPFileWriter.java?view=diff&rev=503560&r1=503559&r2=503560
==============================================================================
--- webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ParamCPPFileWriter.java (original)
+++ webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ParamCPPFileWriter.java Sun Feb 4 21:54:41 2007
@@ -86,7 +86,7 @@
protected abstract void writeGlobalCodes() throws WrapperFault;
protected File getFilePath() throws WrapperFault
{
- classname = CUtils.sanitiseClassName( classname);
+ classname = CUtils.sanitizeString( classname);
String targetOutputLocation = this.wscontext.getWrapInfo().getTargetOutputLocation();
if (targetOutputLocation.endsWith("/"))
Modified: webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ParmHeaderFileWriter.java
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ParmHeaderFileWriter.java?view=diff&rev=503560&r1=503559&r2=503560
==============================================================================
--- 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 Sun Feb 4 21:54:41 2007
@@ -74,7 +74,7 @@
writer.write("\n");
- classname = CUtils.sanitiseClassName( classname);
+ classname = CUtils.sanitizeString( classname);
this.writer.write("class STORAGE_CLASS_INFO " + classname);
if (this.type.isFault())
@@ -141,7 +141,7 @@
writer.write("\nprivate:\n");
foundDeepCopyType = true;
}
- writer.write("\tbool __axis_deepcopy_" + attribs[i].getParamNameWithoutSymbols() + ";\n");
+ writer.write("\tbool __axis_deepcopy_" + attribs[i].getParamNameAsMember() + ";\n");
}
}
}
@@ -174,7 +174,7 @@
String restrictionBaseType = type.getRestrictionBaseType();
if (null != restrictionBaseType )
{
- langTypeName = CUtils.sanitiseClassName(restrictionBaseType);
+ langTypeName = CUtils.sanitizeString(restrictionBaseType);
writer.write( "#include \"" + langTypeName + ".hpp\"\n\n");
}
else
@@ -314,19 +314,12 @@
{
writer.write("public:\n");
for (int i = 0; i < attribs.length; i++)
- {
- // Ensure field name is valid and does not cause conflict with class names
- String sanitizedAttrName = CUtils.sanitiseAttributeName(attribs[i].getParamName());
- attribs[i].setMethodName(sanitizedAttrName);
- if (CUtils.classExists(wscontext, sanitizedAttrName))
- sanitizedAttrName += "_Ref";
- attribs[i].setParamName(sanitizedAttrName);
-
+ {
// Following will set the correct type
String paramType = getCorrectParmNameConsideringArraysAndComplexTypes(attribs[i]);
// Following will set param name - if anyType, we index param name
- String paramName = attribs[i].getParamName();
+ String paramName = attribs[i].getParamNameAsMember();
if(attribs[i].isAnyType())
{
anyCounter += 1;
@@ -361,7 +354,7 @@
writer.write("\t"
+ getCorrectParmNameConsideringArraysAndComplexTypes(extensionBaseAttrib)
+ " "
- + extensionBaseAttrib.getParamNameWithoutSymbols() + ";\n");
+ + extensionBaseAttrib.getParamNameAsMember() + ";\n");
}
}
catch (IOException e)
Modified: webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/WrapWriter.java
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/WrapWriter.java?view=diff&rev=503560&r1=503559&r2=503560
==============================================================================
--- webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/WrapWriter.java (original)
+++ webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/WrapWriter.java Sun Feb 4 21:54:41 2007
@@ -331,7 +331,7 @@
WrapperUtils.getClassNameFromParamInfoConsideringArrays(
(ParameterInfo) paramsB.get(i),
wscontext);
- parameterName = ((ParameterInfo) paramsB.get(i)).getParamName();
+ parameterName = ((ParameterInfo) paramsB.get(i)).getParamNameAsSOAPString();
ParameterInfo param = (ParameterInfo) paramsB.get(i);
if ((CUtils
.isSimpleType(param.getLangName())))
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?view=diff&rev=503560&r1=503559&r2=503560
==============================================================================
--- 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 Sun Feb 4 21:54:41 2007
@@ -372,7 +372,7 @@
if ("string".equals (elementType))
{
writer.write ("\tm_pCall->setSOAPMethodAttribute(\""
- + param.getParamName () + "\", \"\", Value" + i + ");\n");
+ + param.getParamNameAsSOAPString () + "\", \"\", Value" + i + ");\n");
}
else if ("int".equals (elementType))
{
@@ -380,7 +380,7 @@
writer.write ("\t\tchar buffer[20];\n");
writer.write ("\t\tsprintf(buffer,\"%d\", Value" + i + ");\n");
writer.write ("\t\tm_pCall->setSOAPMethodAttribute(\"" +
- param.getParamName () + "\", \"\", buffer);\n");
+ param.getParamNameAsSOAPString () + "\", \"\", buffer);\n");
writer.write ("\t}\n");
}
} // end for-loop
@@ -429,7 +429,7 @@
writer.write ("\tm_pCall->addAnyObject(Value" + i);
else
{
- String parameterName = ((ParameterInfo) paramsB.get (i)).getElementNameAsString ();
+ String parameterName = ((ParameterInfo) paramsB.get (i)).getElementNameAsSOAPString ();
String namespace = ((ParameterInfo) paramsB.get (i)).getElementName ().getNamespaceURI ();
if (((ParameterInfo)paramsB.get(i)).isOptional())
@@ -608,7 +608,7 @@
containedType = CUtils.getclass4qname (qname);
writer.write("\n\t\t\tAxis_Array * pReturn" + i + " = m_pCall->getBasicArray(" + CUtils.getXSDTypeForBasicType (containedType)
- + ", \"" + currentType.getParamName ()
+ + ", \"" + currentType.getParamNameAsSOAPString ()
+ "\", 0);\n\n");
writer.write("\t\t\tif( pReturn" + i + " != NULL && OutValue" + i + " != NULL)\n");
writer.write("\t\t\t{\n");
@@ -633,7 +633,7 @@
+ ", (void*) Axis_DeSerialize_" + containedType
+ ", (void*) Axis_Create_" + containedType
+ ", (void*) Axis_Delete_" + containedType
- + ", \"" + currentType.getElementNameAsString ()
+ + ", \"" + currentType.getElementNameAsSOAPString ()
+ "\", Axis_URI_" + containedType + ");\n");
writer.write("\t\t\t}\n");
writer.write("\t\t\telse\n");
@@ -645,7 +645,7 @@
+ ", (void*) Axis_DeSerialize_" + containedType
+ ", (void*) Axis_Create_" + containedType
+ ", (void*) Axis_Delete_" + containedType
- + ", \"" + currentType.getElementNameAsString ()
+ + ", \"" + currentType.getElementNameAsSOAPString ()
+ "\", Axis_URI_" + containedType + ");\n");
writer.write("\t\t\t\tdelete pTemp" + i + ";\n");
writer.write("\t\t\t}\n");
@@ -668,7 +668,7 @@
xsdType += " *";
}
- writer.write( "\t\t\t" + currentParaType + " pReturn" + i + " = m_pCall->" + CUtils.getParameterGetValueMethodName( baseTypeName, false) + "( \"" + currentType.getParamName() + "\", 0);\n");
+ writer.write( "\t\t\t" + currentParaType + " pReturn" + i + " = m_pCall->" + CUtils.getParameterGetValueMethodName( baseTypeName, false) + "( \"" + currentType.getParamNameAsSOAPString() + "\", 0);\n");
writer.write( "\n");
writer.write( "\t\t\tif( pReturn" + i + " != NULL && OutValue" + i + " != NULL)\n");
writer.write( "\t\t\t\t{\n");
@@ -696,7 +696,7 @@
}
else
{
- writer.write( "\t\t\t" + currentParaType + " * pReturn" + i + " = m_pCall->" + CUtils.getParameterGetValueMethodName( baseTypeName, false) + "( \"" + currentType.getParamName() + "\", 0);\n");
+ writer.write( "\t\t\t" + currentParaType + " * pReturn" + i + " = m_pCall->" + CUtils.getParameterGetValueMethodName( baseTypeName, false) + "( \"" + currentType.getParamNameAsSOAPString() + "\", 0);\n");
writer.write( "\n");
writer.write( "\t\t\tif( pReturn" + i + " != NULL && OutValue" + i + " != NULL)\n");
writer.write( "\t\t\t{\n");
@@ -734,7 +734,7 @@
+ "*)m_pCall->getCmplxObject((void*) Axis_DeSerialize_" + currentParaType
+ ", (void*) Axis_Create_" + currentParaType
+ ", (void*) Axis_Delete_" + currentParaType + ",\""
- + currentType.getElementNameAsString () + "\", 0);\n");
+ + currentType.getElementNameAsSOAPString () + "\", 0);\n");
}
} // end for-loop for paramsC
@@ -763,7 +763,7 @@
containedType = CUtils.getclass4qname (qname);
writer.write ("\t\t\tAxis_Array * RetAxisArray = m_pCall->getBasicArray("
+ CUtils.getXSDTypeForBasicType (containedType)
- + ", \"" + returntype.getParamName () + "\", 0);\n");
+ + ", \"" + returntype.getParamNameAsSOAPString () + "\", 0);\n");
writer.write ("\t\t\tRetArray->clone(*RetAxisArray);\n");
writer.write ("\t\t\tAxis::AxisDelete( (void *)RetAxisArray, XSD_ARRAY);\n");
}
@@ -774,7 +774,7 @@
+ containedType
+ ", (void*) Axis_Create_" + containedType
+ ", (void*) Axis_Delete_" + containedType
- + ", \"" + returntype.getElementNameAsString ()
+ + ", \"" + returntype.getElementNameAsSOAPString ()
+ "\", Axis_URI_" + containedType + ");\n");
}
@@ -791,13 +791,13 @@
{
writer.write( "\t\t\t" + outparamType + " pReturn = m_pCall->"
+ CUtils.getParameterGetValueMethodName( outparamType, false)
- + "(\"" + returntype.getParamName() + "\", 0);\n");
+ + "(\"" + returntype.getParamNameAsSOAPString() + "\", 0);\n");
}
else
{
writer.write( "\t\t\t" + outparamType + " * pReturn = m_pCall->"
+ CUtils.getParameterGetValueMethodName( outparamType, false)
- + "(\"" + returntype.getParamName() + "\", 0);\n");
+ + "(\"" + returntype.getParamNameAsSOAPString() + "\", 0);\n");
}
writer.write( "\n");
@@ -825,7 +825,7 @@
writer.write ("\t\t\t" + outparamType +
" pReturn = m_pCall->" +
CUtils.getParameterGetValueMethodName(outparamType,false) + "(\"" +
- returntype.getParamName () + "\", 0);\n");
+ returntype.getParamNameAsSOAPString () + "\", 0);\n");
writer.write ("\t\t\tif(pReturn)\n");
writer.write ("\t\t\t{\n");
writer.write ("\t\t\t\tRet = new char[strlen( pReturn) + 1];\n");
@@ -837,7 +837,7 @@
{
writer.write ("\t\t\t" + outparamType + " * pReturn = m_pCall->" +
CUtils.getParameterGetValueMethodName(outparamType, false) + "(\"" +
- returntype.getSOAPElementNameAsString() + "\", 0);\n");
+ returntype.getElementNameAsSOAPString() + "\", 0);\n");
writer.write ("\t\t\tif(pReturn)\n");
writer.write ("\t\t\t{\n");
@@ -876,7 +876,7 @@
")m_pCall->getCmplxObject((void*) Axis_DeSerialize_" + outparamTypeBase +
", (void*) Axis_Create_" + outparamTypeBase +
", (void*) Axis_Delete_" + outparamTypeBase + ",\"" +
- returntype.getElementNameAsString () + "\", 0);\n\t\t}\n");
+ returntype.getElementNameAsSOAPString () + "\", 0);\n\t\t}\n");
}
else
{
@@ -884,7 +884,7 @@
+ "*)m_pCall->getCmplxObject((void*) Axis_DeSerialize_" + outparamType +
", (void*) Axis_Create_" + outparamType +
", (void*) Axis_Delete_" + outparamType + ",\"" +
- returntype.getElementNameAsString () + "\", 0);\n\t\t}\n");
+ returntype.getElementNameAsSOAPString () + "\", 0);\n\t\t}\n");
}
writer.write ("\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?view=diff&rev=503560&r1=503559&r2=503560
==============================================================================
--- 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 Sun Feb 4 21:54:41 2007
@@ -158,7 +158,7 @@
else
paraTypeName = param.getLangName();
- elementName = param.getElementNameAsString();
+ elementName = param.getElementNameAsSOAPString();
if (type != null && type.isSimpleType())
{
if (param.isNillable() &&
@@ -335,7 +335,7 @@
if (returntype != null)
{
/* Invoke the service when return type not void */
- returnParamName = returntype.getElementNameAsString();
+ returnParamName = returntype.getElementNameAsSOAPString();
writer.write("\t\t" + outparamType);
if ((outparamType.lastIndexOf ("_Array") > 0)
||(!returntypeisarray
@@ -469,8 +469,7 @@
returntypeissimple = CUtils.isSimpleType(outparamType);
}
- returnParamName = param.getElementName().getLocalPart();
- returnParamName = returnParamName.substring(returnParamName.lastIndexOf(">")+1);
+ returnParamName = param.getElementNameAsSOAPString();
if (returntypeissimple)
{
Modified: webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/info/AttributeInfo.java
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/info/AttributeInfo.java?view=diff&rev=503560&r1=503559&r2=503560
==============================================================================
--- webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/info/AttributeInfo.java (original)
+++ webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/info/AttributeInfo.java Sun Feb 4 21:54:41 2007
@@ -37,7 +37,6 @@
private String typeName;
private String typeNamespace;
private String className;
- private String methodName;
//this variable states whether the attribute is an xsd:choice
private boolean choiceElement = false;
@@ -61,7 +60,6 @@
str = str + "typeName = " + typeName + "\n";
str = str + "typeNamespace = " + typeNamespace + "\n";
str = str + "className =" + className + "\n";
- str = str + "attribNameAsMember =" + getParamNameAsMember() + "\n";
str = str + "choiceElement = " + choiceElement + "\n";
str = str + "allElement =" + allElement + "\n";
str = str + "nsQualified =" + nsQualified + "\n";
@@ -162,18 +160,6 @@
this.isSimpleType = isSimpleType;
}
- // TODO - probably can remove since we sanitize attribute name.
- public String getParamNameAsMember()
- {
- String attribNameAsMember = super.getParamNameWithoutSymbols();
-
- // need to deal with _Ref stuff :(
- if (this.className != null && this.className.equals(attribNameAsMember))
- attribNameAsMember = "m_" + attribNameAsMember;
-
- return attribNameAsMember;
- }
-
//getter and setter for choiceElement
public boolean getChoiceElement()
{
@@ -240,15 +226,5 @@
public void setMinOccurs(int minOccurs)
{
this.minOccurs = minOccurs;
- }
-
- public String getMethodName()
- {
- return methodName;
- }
-
- public void setMethodName(String methodName)
- {
- this.methodName = methodName;
}
}
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?view=diff&rev=503560&r1=503559&r2=503560
==============================================================================
--- 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 Sun Feb 4 21:54:41 2007
@@ -27,30 +27,38 @@
* @author Srinath Perera(hemapani@opensource.lk)
*/
-// TODO - really need to simplify all these routines to turn
-// attribName in proper format!!! I do not think we need most of them, if any.
public class ParameterInfo
{
protected Type type;
- protected String attribName;
- protected QName elementName;
+ protected String attribName = null;
+ protected QName elementName = null;
+ private String elementNameAsSOAPString = null;
+ private String attribNameAsSOAPString = null;
+ private String attribNameAsMember = null;
+ private String methodName=null;
private boolean isAnyType = false;
protected boolean isArray = false;
private boolean isAttribute = false;
private boolean isNillable = false;
private boolean isOptional = false;
+ public ParameterInfo()
+ {}
+
public String toString()
{
String str ="\n---------BEGIN ParameterInfo------------\n";
- str = str + "type = " + type.getName() + "\n";
- str = str + "attribName =" + attribName + "\n";
- str = str + "elementName =" + elementName + "\n";
- str = str + "isAnyType =" + isAnyType + "\n";
- str = str + "isArray =" + isArray + "\n";
- str = str + "isAttribute =" + isAttribute + "\n";
- str = str + "isNillable = " + isNillable + "\n";
- str = str + "isOptional = " + isOptional + "\n";
+ str = str + "type = " + type.getName() + "\n";
+ str = str + "attribName =" + attribName + "\n";
+ str = str + "attribNameAsMember =" + attribNameAsMember + "\n";
+ str = str + "attribNameAsSOAPString =" + attribNameAsSOAPString + "\n";
+ str = str + "elementName =" + elementName + "\n";
+ str = str + "elementNameAsSOAPString =" + elementNameAsSOAPString + "\n";
+ str = str + "isAnyType =" + isAnyType + "\n";
+ str = str + "isArray =" + isArray + "\n";
+ str = str + "isAttribute =" + isAttribute + "\n";
+ str = str + "isNillable = " + isNillable + "\n";
+ str = str + "isOptional = " + isOptional + "\n";
str = str + "------------END ParameterInfo-------------\n";
return str;
@@ -93,57 +101,41 @@
this.isAttribute = isAttribute;
}
- public String getParamName()
+ public void setParamName(String paramName, TypeMap typeMap)
{
- if (attribName.lastIndexOf(SymbolTable.ANON_TOKEN) > 1)
+ // Get the last identifier after anonymous token
+ if (paramName.lastIndexOf(SymbolTable.ANON_TOKEN) > 1)
{
- attribName =
- attribName.substring(attribName.lastIndexOf(SymbolTable.ANON_TOKEN) + 1,
- attribName.length());
+ paramName =
+ paramName.substring(paramName.lastIndexOf(SymbolTable.ANON_TOKEN) + 1,
+ paramName.length());
}
- // This second call to TypeMap.resoleveWSDL2LanguageNameClashes
- // is made to make sure after replacing ANON_TOKEN it is still not a keyword
- attribName = CUtils.resolveWSDL2LanguageNameClashes(attribName);
-
- return attribName;
+ attribName = paramName;
+ attribNameAsSOAPString = paramName;
+
+ // Now generate a code-safe representation of the name
+ attribNameAsMember = CUtils.sanitizeString(attribName);
+ methodName = attribNameAsMember;
+
+ if (typeMap != null && CUtils.classExists(typeMap, attribNameAsMember))
+ attribNameAsMember += "_Ref";
+ attribNameAsMember = CUtils.resolveWSDL2LanguageNameClashes(attribNameAsMember);
}
- // To avoid the '-' in attribute name.
- // TODO - not needed, get rid of this.
- public String getParamNameWithoutSymbols()
+ public String getParamName()
{
- String result = this.getParamName();
-
- char[] symbols = TypeMap.getSymbols();
-
- for (int j = 0; j < symbols.length; j++)
- result = result.replace(symbols[j], '_');
-
- return result;
+ return attribName;
}
- public String getParamNameAsSOAPElement()
+ public String getParamNameAsMember()
{
- String result = attribName;
-
- if (attribName.lastIndexOf(SymbolTable.ANON_TOKEN) > 1)
- {
- result =
- attribName.substring(attribName.lastIndexOf(SymbolTable.ANON_TOKEN) + 1,
- attribName.length());
- }
-
- // Make sure SOAP tag name is not prefixed because it is a key word
- if( result.charAt(0) == '_')
- {
- String tagname = result.substring(1, result.length() );
-
- if( result.equals( CUtils.resolveWSDL2LanguageNameClashes(tagname)))
- result = tagname;
+ return attribNameAsMember;
+ }
- }
- return result;
+ public String getParamNameAsSOAPString()
+ {
+ return attribNameAsSOAPString;
}
/**
@@ -153,36 +145,16 @@
{
return type != null && attribName.equals(type.getLanguageSpecificName());
}
-
- public void setParamName(String paramName)
- {
- if (paramName.lastIndexOf(SymbolTable.ANON_TOKEN) > 1)
- {
- paramName =
- paramName.substring(paramName.lastIndexOf(SymbolTable.ANON_TOKEN) + 1,
- paramName.length());
- }
- paramName =CUtils.resolveWSDL2LanguageNameClashes(paramName);
-
- this.attribName = paramName;
- }
-
- public ParameterInfo(Type type, String attribName)
- {
- this.type = type;
- this.attribName = attribName;
- }
public Type getType()
{
return type;
}
- /**
- *
- */
- public ParameterInfo()
- {}
+ public void setType(Type type)
+ {
+ this.type = type;
+ }
/**
* @return
@@ -192,21 +164,9 @@
return elementName;
}
- public String getElementNameAsString()
- {
- return CUtils.resolveWSDL2LanguageNameClashes(getSOAPElementNameAsString());
- }
-
- public String getSOAPElementNameAsString()
+ public String getElementNameAsSOAPString()
{
- String paramName = elementName.getLocalPart();
- if (paramName.lastIndexOf(SymbolTable.ANON_TOKEN) > 1)
- {
- paramName =
- paramName.substring(paramName.lastIndexOf(SymbolTable.ANON_TOKEN) + 1,
- paramName.length());
- }
- return paramName;
+ return elementNameAsSOAPString;
}
/**
@@ -215,6 +175,19 @@
public void setElementName(QName name)
{
elementName = name;
+ if (elementName != null)
+ {
+ String paramName = elementName.getLocalPart();
+ if (paramName.lastIndexOf(SymbolTable.ANON_TOKEN) > 1)
+ {
+ paramName =
+ paramName.substring(paramName.lastIndexOf(SymbolTable.ANON_TOKEN) + 1,
+ paramName.length());
+ }
+ elementNameAsSOAPString = paramName;
+ }
+ else
+ elementNameAsSOAPString=null;
}
public QName getSchemaName()
@@ -228,15 +201,6 @@
}
/**
- * Sets the type.
- * @param type The type to set
- */
- public void setType(Type type)
- {
- this.type = type;
- }
-
- /**
* @return
*/
public boolean isAnyType()
@@ -264,5 +228,14 @@
public boolean isOptional()
{
return isOptional;
+ }
+ public String getMethodName()
+ {
+ return methodName;
+ }
+
+ public void setMethodName(String methodName)
+ {
+ this.methodName = methodName;
}
}
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?view=diff&rev=503560&r1=503559&r2=503560
==============================================================================
--- 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 Sun Feb 4 21:54:41 2007
@@ -137,7 +137,7 @@
this.languageSpecificName = this.name.getLocalPart();
// Ensure name is valid and does not clash with language specific constructs
- this.languageSpecificName = CUtils.sanitiseClassName(this.languageSpecificName);
+ this.languageSpecificName = CUtils.sanitizeString(this.languageSpecificName);
// Indicate whether type is anonymous. Anonymous type start with '>' and are not
// externalized by default.
@@ -195,9 +195,6 @@
}
/**
- * The Type take the attributes name to lowercase when add,
- * If there is two names like "Name" and "name"
- * they will convert to "name" Is that acceptable ....
*/
public void setTypeNameForElementName(ElementInfo element)
{
@@ -210,8 +207,6 @@
attribName.lastIndexOf(SymbolTable.ANON_TOKEN) + 1,attribName.length());
}
- attribName = CUtils.resolveWSDL2LanguageNameClashes(attribName);
-
this.elements.put(attribName, element);
this.vElements.add(attribName);
}
@@ -228,7 +223,7 @@
public void setLanguageSpecificName(String languageSpecificName)
{
- this.languageSpecificName = CUtils.sanitiseClassName(languageSpecificName);
+ this.languageSpecificName = CUtils.sanitizeString(languageSpecificName);
}
/**
Modified: webservices/axis/trunk/c/tests/auto_build/testcases/output/CombinedAll_ServerResponse.expected
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/tests/auto_build/testcases/output/CombinedAll_ServerResponse.expected?view=diff&rev=503560&r1=503559&r2=503560
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/output/CombinedAll_ServerResponse.expected (original)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/output/CombinedAll_ServerResponse.expected Sun Feb 4 21:54:41 2007
@@ -9,11 +9,11 @@
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SOAP-ENV:Body>
<ns1:echoAllResponse xmlns:ns1="http://soapinterop.org/">
-<_return><ns2:NonAllIntValue xmlns:ns2="http://soapinterop.org/xsd">3</ns2:NonAllIntValue>
+<return><ns2:NonAllIntValue xmlns:ns2="http://soapinterop.org/xsd">3</ns2:NonAllIntValue>
<ns3:Value0 xmlns:ns3="http://soapinterop.org/xsd">5</ns3:Value0>
<ns4:Value2 xmlns:ns4="http://soapinterop.org/xsd">TINTIN</ns4:Value2>
<ns5:NonAllStringValue xmlns:ns5="http://soapinterop.org/xsd">HELLO</ns5:NonAllStringValue>
-</_return>
+</return>
</ns1:echoAllResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Modified: webservices/axis/trunk/c/tests/auto_build/testcases/output/CombinedChoice_ServerResponse.expected
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/tests/auto_build/testcases/output/CombinedChoice_ServerResponse.expected?view=diff&rev=503560&r1=503559&r2=503560
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/output/CombinedChoice_ServerResponse.expected (original)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/output/CombinedChoice_ServerResponse.expected Sun Feb 4 21:54:41 2007
@@ -9,10 +9,10 @@
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SOAP-ENV:Body>
<ns1:echoChoiceResponse xmlns:ns1="http://soapinterop.org/">
-<_return><ns2:NonChoiceIntValue xmlns:ns2="http://soapinterop.org/xsd">5</ns2:NonChoiceIntValue>
+<return><ns2:NonChoiceIntValue xmlns:ns2="http://soapinterop.org/xsd">5</ns2:NonChoiceIntValue>
<ns3:IntValue xmlns:ns3="http://soapinterop.org/xsd">5</ns3:IntValue>
<ns4:NonChoiceStringValue xmlns:ns4="http://soapinterop.org/xsd">NonChoiceStringValue</ns4:NonChoiceStringValue>
-</_return>
+</return>
</ns1:echoChoiceResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Modified: webservices/axis/trunk/c/tests/auto_build/testcases/output/UnboundedChoice_ServerResponse.expected
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/tests/auto_build/testcases/output/UnboundedChoice_ServerResponse.expected?view=diff&rev=503560&r1=503559&r2=503560
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/output/UnboundedChoice_ServerResponse.expected (original)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/output/UnboundedChoice_ServerResponse.expected Sun Feb 4 21:54:41 2007
@@ -9,12 +9,12 @@
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SOAP-ENV:Body>
<ns1:echoChoiceResponse xmlns:ns1="http://soapinterop.org/">
-<_return><ns3:IntValue xmlns:ns3="http://soapinterop.org/xsd">1</ns3:IntValue>
+<return><ns3:IntValue xmlns:ns3="http://soapinterop.org/xsd">1</ns3:IntValue>
<ns4:IntValue xmlns:ns4="http://soapinterop.org/xsd">2</ns4:IntValue>
<ns5:IntValue xmlns:ns5="http://soapinterop.org/xsd">3</ns5:IntValue>
<ns6:IntValue xmlns:ns6="http://soapinterop.org/xsd">4</ns6:IntValue>
<ns7:IntValue xmlns:ns7="http://soapinterop.org/xsd">5</ns7:IntValue>
-</_return>
+</return>
</ns1:echoChoiceResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Modified: webservices/axis/trunk/c/tests/auto_build/testcases/output/UnboundedStringChoice_ServerResponse.expected
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/tests/auto_build/testcases/output/UnboundedStringChoice_ServerResponse.expected?view=diff&rev=503560&r1=503559&r2=503560
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/output/UnboundedStringChoice_ServerResponse.expected (original)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/output/UnboundedStringChoice_ServerResponse.expected Sun Feb 4 21:54:41 2007
@@ -9,12 +9,12 @@
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SOAP-ENV:Body>
<ns1:echoChoiceResponse xmlns:ns1="http://soapinterop.org/">
-<_return><ns3:StringValue xmlns:ns3="http://soapinterop.org/xsd">a</ns3:StringValue>
+<return><ns3:StringValue xmlns:ns3="http://soapinterop.org/xsd">a</ns3:StringValue>
<ns4:StringValue xmlns:ns4="http://soapinterop.org/xsd">b</ns4:StringValue>
<ns5:StringValue xmlns:ns5="http://soapinterop.org/xsd">c</ns5:StringValue>
<ns6:StringValue xmlns:ns6="http://soapinterop.org/xsd">d</ns6:StringValue>
<ns7:StringValue xmlns:ns7="http://soapinterop.org/xsd">e</ns7:StringValue>
-</_return>
+</return>
</ns1:echoChoiceResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org