ws-axis-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sam...@apache.org
Subject cvs commit: ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal ClientStubWriter.java
Date Fri, 11 Mar 2005 04:17:23 GMT
samisa      2005/03/10 20:17:23

  Modified:    c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal
                        ClientStubWriter.java
  Log:
  There were may fixes needed to this file to solve AXISCPP-520.
  I do not know why on earth this source file was this much broken.
  As far as I could test, these fixes seem to have minimal sideeffects, however I admit that
there is a risk.
  I myself do not like the fixes I did here. However I had to live with these fixes as I wanted
to minimize the side effects and for the very reason I did not want to change any other file
(so that in case of problems a roll back would be trivial)
  
  Revision  Changes    Path
  1.79      +89 -12    ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/ClientStubWriter.java
  
  Index: ClientStubWriter.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/ClientStubWriter.java,v
  retrieving revision 1.78
  retrieving revision 1.79
  diff -u -r1.78 -r1.79
  --- ClientStubWriter.java	9 Mar 2005 14:49:38 -0000	1.78
  +++ ClientStubWriter.java	11 Mar 2005 04:17:23 -0000	1.79
  @@ -219,9 +219,13 @@
               }
               else
               {
  -                outparamType = retType.getLanguageSpecificName();
  +                outparamType =  WrapperUtils.getClassNameFromParamInfoConsideringArrays(
  +                    returntype,
  +                    wscontext);
  +//retType.getLanguageSpecificName();
  +            returntypeisarray = (outparamType.lastIndexOf("Array") > 0);
               }
  -            returntypeisarray = retType.isArray();
  +            returntypeisarray |= retType.isArray();
           }
           else
           {
  @@ -260,6 +264,10 @@
           	{
                   writer.write(outparamType);
               }
  +            else if(outparamType.lastIndexOf("*") > 0)
  +        	{
  +                writer.write(outparamType);
  +            }
               else
               { //for AnyType too
                   writer.write(outparamType + "*");
  @@ -280,9 +288,15 @@
                   }
                   else
                   {
  -                    paraTypeName = type.getLanguageSpecificName();
  +                    //paraTypeName = type.getLanguageSpecificName();
  +                    paraTypeName = WrapperUtils.getClassNameFromParamInfoConsideringArrays(
  +                    returntype,
  +                    wscontext);
  +//type.getLanguageSpecificName();
  +                //typeisarray = true;
  +            typeisarray= (outparamType.lastIndexOf("Array") > 0);
                   }
  -                typeisarray = type.isArray();
  +                typeisarray |= type.isArray();
               }
               else
               {
  @@ -300,6 +314,10 @@
               {
                   writer.write(paraTypeName + " Value0");
               }
  +            else if(paraTypeName.lastIndexOf("*") > 0)
  +        	{
  +                writer.write(paraTypeName + " Value0");
  +            }
               else
               { //for AnyType too
                   writer.write(paraTypeName + "* Value0");
  @@ -318,9 +336,13 @@
                       }
                       else
                       {
  -                        paraTypeName = type.getLanguageSpecificName();
  +                        ///paraTypeName = type.getLanguageSpecificName();
  +                    paraTypeName = WrapperUtils.getClassNameFromParamInfoConsideringArrays(
  +                    returntype,
  +                    wscontext);
  +            typeisarray= (outparamType.lastIndexOf("Array") > 0);
                       }
  -                    typeisarray = type.isArray();
  +                    typeisarray |= type.isArray();
                   }
                   else
                   {
  @@ -339,6 +361,10 @@
                   {
                       writer.write(", " + paraTypeName + " Value" + i);
                   }
  +            else if(paraTypeName.lastIndexOf("*") > 0)
  +        	{
  +                writer.write(", " + paraTypeName + " Value" + i );
  +            }
                   else
                   { //for AnyType too
                       writer.write(", " + paraTypeName + "* Value" + i);
  @@ -380,6 +406,10 @@
   
                   if (!returntypeissimple)
                   { //for AnyType too
  +            if(outparamType.lastIndexOf("*") > 0)
  +        	{
  +                    writer.write(outparamType + " pReturn = NULL;\n");
  +            }else
                       writer.write(outparamType + "* pReturn = NULL;\n");
                       //for complex types
                   }
  @@ -525,8 +555,9 @@
                       else
                       {
                           paraTypeName = type.getLanguageSpecificName();
  +            typeisarray= (outparamType.lastIndexOf("Array") > 0);
                       }
  -                    typeisarray = type.isArray();
  +                    typeisarray |= type.isArray();
                   }
                   else
                   {
  @@ -586,7 +617,12 @@
                       {
                           // Array
                           Type arrayType = WrapperUtils.getArrayType(type);
  -                        QName qname = arrayType.getName();
  +                        
  +                        QName qname = null;
  +                        if (arrayType != null)
  +                             qname = arrayType.getName();
  +                        else
  + 			     qname = type.getName();
                           if (CUtils.isSimpleType(qname))
                           {
                               // Array of simple type
  @@ -766,7 +802,7 @@
                                   + "&)m_pCall->getBasicArray("
                                   + CUtils.getXSDTypeForBasicType(containedType)
                                   + ", \""
  -                                + currentType.getElementName().getLocalPart()
  +                                + currentType.getParamName()//getElementName().getLocalPart()
                                   + "\", 0);\n");
                       }
                       else
  @@ -785,7 +821,7 @@
                                       + CUtils.getXSDTypeForBasicType(
                                           containedType)
                                       + ", \""
  -                                    + currentType.getElementName().getLocalPart()
  +                                    + currentType.getParamName()//getElementName().getLocalPart()
                                       + "\", 0);\n");
                           }
                           else
  @@ -847,6 +883,26 @@
                           {
                               //writer.write("\t\t\t" + currentParamName + " = ("+currentParaType+"*)m_pCall->getCmplxObject((void*)
Axis_DeSerialize_"+currentParaType+", (void*) Axis_Create_"+currentParaType+", (void*) Axis_Delete_"+currentParaType+",\""+currentType.getElementName().getLocalPart()+"\",
0);\n"); 
                               //Samisa 22/08/2004
  +
  +		System.out.println("currentParaType = " + currentParaType);
  +            if(currentParaType.lastIndexOf("*") > 0)
  +        	{
  +writer.write(
  +                                "\t\t\t"
  +                                    + currentParamName
  +                                    + " = ("
  +                                    + currentParaType
  +                                    + ")m_pCall->getCmplxObject((void*) Axis_DeSerialize_"
  +                                    + currentParaType
  +                                    + ", (void*) Axis_Create_"
  +                                    + currentParaType
  +                                    + ", (void*) Axis_Delete_"
  +                                    + currentParaType
  +                                    + ",\""
  +                                    + currentType.getElementNameAsString()
  +                                    + "\", 0);\n");
  +
  +            }else
                               writer.write(
                                   "\t\t\t"
                                       + currentParamName
  @@ -887,7 +943,11 @@
   
                   if (returntypeisarray)
                   {
  -                    QName qname = WrapperUtils.getArrayType(retType).getName();
  +                    QName qname = null;
  +		    if( WrapperUtils.getArrayType(retType) != null)
  +                        qname = WrapperUtils.getArrayType(retType).getName();
  +		    else
  +			qname = retType.getName();
                       String containedType = null;
                       if (CUtils.isSimpleType(qname))
                       {
  @@ -898,7 +958,7 @@
                                   + "&)m_pCall->getBasicArray("
                                   + CUtils.getXSDTypeForBasicType(containedType)
                                   + ", \""
  -                                + returntype.getElementName().getLocalPart()
  +                                + returntype.getParamName()//getElementName().getLocalPart()
                                   + "\", 0);\n\t\t}\n");
                       }
                       else
  @@ -996,6 +1056,23 @@
                           {
                               //writer.write("\t\t\tpReturn = ("+outparamType+"*)m_pCall->getCmplxObject((void*)
Axis_DeSerialize_"+outparamType+", (void*) Axis_Create_"+outparamType+", (void*) Axis_Delete_"+outparamType+",\""+returntype.getElementName().getLocalPart()+"\",
0);\n\t\t}\n"); 
                               //Samisa 22/08/2004
  +		System.out.println("currentParaType = " + outparamType);
  +            if(outparamType.lastIndexOf("*") > 0)
  +        	{
  +                                String outparamTypeBase = outparamType.substring(0, outparamType.lastIndexOf("*")
);
  +				writer.write(
  +                                "\t\t\tpReturn = ("
  +                                    + outparamType
  +                                    + ")m_pCall->getCmplxObject((void*) Axis_DeSerialize_"
  +                                    + outparamTypeBase
  +                                    + ", (void*) Axis_Create_"
  +                                    + outparamTypeBase
  +                                    + ", (void*) Axis_Delete_"
  +                                    + outparamTypeBase
  +                                    + ",\""
  +                                    + returntype.getElementNameAsString()
  +                                    + "\", 0);\n\t\t}\n");
  +		}else
                               writer.write(
                                   "\t\t\tpReturn = ("
                                       + outparamType
  
  
  

Mime
View raw message