axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bu...@apache.org
Subject cvs commit: xml-axis/java/src/org/apache/axis/wsdl/toJava JavaDeployWriter.java JavaGeneratorFactory.java JavaImplWriter.java JavaSkelWriter.java JavaStubWriter.java JavaTestCaseWriter.java
Date Fri, 02 Aug 2002 16:41:42 GMT
butek       2002/08/02 09:41:42

  Modified:    java/src/org/apache/axis/wsdl/symbolTable Parameters.java
                        SymbolTable.java
               java/src/org/apache/axis/wsdl/toJava JavaDeployWriter.java
                        JavaGeneratorFactory.java JavaImplWriter.java
                        JavaSkelWriter.java JavaStubWriter.java
                        JavaTestCaseWriter.java
  Log:
  ...wsdl.symbolTable.Parameters used to have fields:
  returnType
  returnName
  returnMIMEType.
  
  Since Parameter also has these fields, it seemed silly (and awkward, in
  some cases) not to make a returnParam field of class Parameter.
  
  Revision  Changes    Path
  1.4       +3 -11     xml-axis/java/src/org/apache/axis/wsdl/symbolTable/Parameters.java
  
  Index: Parameters.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/wsdl/symbolTable/Parameters.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- Parameters.java	24 Jul 2002 16:15:03 -0000	1.3
  +++ Parameters.java	2 Aug 2002 16:41:41 -0000	1.4
  @@ -67,15 +67,8 @@
       // This vector contains instances of the Parameter class
       public Vector list = new Vector();
   
  -    // The type of the first output part, used as the method's return value
  -    public TypeEntry returnType = null;
  -
  -    // The name of the return type (from the part name of the output message.
  -    // Used to create the RPCParam for the return value.
  -    public QName returnName = null;
  -
  -    // The MIME type of the return, null if it doesn't exist.
  -    public String returnMIMEType = null;
  +    // The return info is stored as a Parameter.
  +    public Parameter returnParam = null;
   
       // A map of the faults
       public Map faults = null;
  @@ -89,8 +82,7 @@
       public int outputs = 0;
   
       public String toString() {
  -        return "\nreturnType = " + returnType
  -                + "\nreturnName = " + returnName
  +        return "\nreturnParam = " + returnParam
                   + "\nfaults = " + faults
                   + "\nsignature = " + signature
                   + "\n(inputs, inouts, outputs) = (" + inputs + ", " + inouts + ", " + outputs
+ ")"
  
  
  
  1.20      +5 -8      xml-axis/java/src/org/apache/axis/wsdl/symbolTable/SymbolTable.java
  
  Index: SymbolTable.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/wsdl/symbolTable/SymbolTable.java,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- SymbolTable.java	2 Aug 2002 16:05:57 -0000	1.19
  +++ SymbolTable.java	2 Aug 2002 16:41:41 -0000	1.20
  @@ -1073,14 +1073,11 @@
           // is the return value.  If there are more than 1, then they are 
           // out parameters.
           if (outputs.size() == 1) {
  -            Parameter returnParam = (Parameter)outputs.get(0);
  -            parameters.returnType = returnParam.getType();
  -            parameters.returnMIMEType = returnParam.getMIMEType();
  -            if (parameters.returnType instanceof DefinedElement) {
  -                parameters.returnName = 
  -                        ((DefinedElement)parameters.returnType).getQName();
  -            } else {
  -                parameters.returnName = returnParam.getQName(); 
  +            parameters.returnParam = (Parameter)outputs.get(0);
  +            if (parameters.returnParam.getType() instanceof DefinedElement) {
  +                parameters.returnParam.setQName(
  +                        ((DefinedElement)parameters.returnParam.getType())
  +                        .getQName());
               }
               ++parameters.outputs;
           }
  
  
  
  1.55      +6 -6      xml-axis/java/src/org/apache/axis/wsdl/toJava/JavaDeployWriter.java
  
  Index: JavaDeployWriter.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/wsdl/toJava/JavaDeployWriter.java,v
  retrieving revision 1.54
  retrieving revision 1.55
  diff -u -r1.54 -r1.55
  --- JavaDeployWriter.java	24 Jul 2002 16:15:04 -0000	1.54
  +++ JavaDeployWriter.java	2 Aug 2002 16:41:41 -0000	1.55
  @@ -353,13 +353,13 @@
                       // Get the operation QName
                       QName elementQName = Utils.getOperationQName(bindingOper);
   
  -                    // Get the operation's return QName
  +                    // Get the operation's return QName and type
                       QName returnQName = null;
  -                    if (params.returnName != null)
  -                        returnQName = params.returnName;
  -
  -                    // Get the QName representing the type
  -                    QName returnType = Utils.getXSIType(params.returnType);
  +                    QName returnType = null;
  +                    if (params.returnParam != null) {
  +                        returnQName = params.returnParam.getQName();
  +                        returnType = Utils.getXSIType(params.returnParam.getType());
  +                    }
   
                       // Write the operation metadata
                       writeOperation(pw, javaOperName, elementQName, 
  
  
  
  1.17      +2 -9      xml-axis/java/src/org/apache/axis/wsdl/toJava/JavaGeneratorFactory.java
  
  Index: JavaGeneratorFactory.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/wsdl/toJava/JavaGeneratorFactory.java,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- JavaGeneratorFactory.java	2 Aug 2002 12:55:33 -0000	1.16
  +++ JavaGeneratorFactory.java	2 Aug 2002 16:41:41 -0000	1.17
  @@ -842,15 +842,8 @@
           String name = Utils.xmlNameToJava(opName);
   
           String ret = "void";
  -        if (parms.returnType != null) {
  -            // Construct a Parameter for the return.
  -            // RJB NOTE:  The return info should really just be a Parameter
  -            //            rather than duplicating the same info on the
  -            //            Parameters object.
  -            Parameter returnParm = new Parameter();
  -            returnParm.setMIMEType(parms.returnMIMEType);
  -            returnParm.setType(parms.returnType);
  -            ret = Utils.getParameterTypeName(returnParm);
  +        if (parms.returnParam != null) {
  +            ret = Utils.getParameterTypeName(parms.returnParam);
           }
           String signature = "    public " + ret + " " + name + "(";
   
  
  
  
  1.27      +8 -6      xml-axis/java/src/org/apache/axis/wsdl/toJava/JavaImplWriter.java
  
  Index: JavaImplWriter.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/wsdl/toJava/JavaImplWriter.java,v
  retrieving revision 1.26
  retrieving revision 1.27
  diff -u -r1.26 -r1.27
  --- JavaImplWriter.java	20 Jun 2002 20:35:47 -0000	1.26
  +++ JavaImplWriter.java	2 Aug 2002 16:41:41 -0000	1.27
  @@ -87,6 +87,7 @@
   import org.apache.axis.wsdl.symbolTable.PortTypeEntry;
   import org.apache.axis.wsdl.symbolTable.SchemaUtils;
   import org.apache.axis.wsdl.symbolTable.SymbolTable;
  +import org.apache.axis.wsdl.symbolTable.TypeEntry;
   
   import org.w3c.dom.Node;
   
  @@ -225,16 +226,17 @@
           }
   
           // Print the return statement
  -        if (parms.returnType != null) {
  +        if (parms.returnParam != null) {
  +            TypeEntry returnType = parms.returnParam.getType();
               pw.print("        return ");
   
  -            if (Utils.isPrimitiveType(parms.returnType)) {
  -                String returnType = parms.returnType.getName();
  -                if ("boolean".equals(returnType)) {
  +            if (Utils.isPrimitiveType(returnType)) {
  +                String returnString = returnType.getName();
  +                if ("boolean".equals(returnString)) {
                       pw.println("false;");
  -                } else if ("byte".equals(returnType)) {
  +                } else if ("byte".equals(returnString)) {
                       pw.println("(byte)-3;");
  -                } else if ("short".equals(returnType)) {
  +                } else if ("short".equals(returnString)) {
                       pw.println("(short)-3;");
                   } else {
                       pw.println("-3;");
  
  
  
  1.41      +13 -15    xml-axis/java/src/org/apache/axis/wsdl/toJava/JavaSkelWriter.java
  
  Index: JavaSkelWriter.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/wsdl/toJava/JavaSkelWriter.java,v
  retrieving revision 1.40
  retrieving revision 1.41
  diff -u -r1.40 -r1.41
  --- JavaSkelWriter.java	2 Aug 2002 12:55:33 -0000	1.40
  +++ JavaSkelWriter.java	2 Aug 2002 16:41:41 -0000	1.41
  @@ -199,12 +199,16 @@
                   pw.println("        };");
   
                   // Get the return name QName and type
  -                QName retName = parameters.returnName;
  -                QName retType = Utils.getXSIType(parameters.returnType);
  +                QName retName = null;
  +                QName retType = null;
  +                if (parameters.returnParam != null) {
  +                    retName = parameters.returnParam.getQName();
  +                    retType = Utils.getXSIType(parameters.returnParam.getType());
  +                }
   
                   String returnStr;
                   if (retName != null) {
  -                    returnStr = Utils.getNewQName(parameters.returnName);
  +                    returnStr = Utils.getNewQName(retName);
                   } else {
                       returnStr = "null";
                   }
  @@ -217,8 +221,9 @@
                   }
   
                   // Is the return type a MIME type?
  -                if (parameters.returnMIMEType != null) {
  -                    pw.println("        _oper.getReturnParamDesc().setMIMEType(\"" + parameters.returnMIMEType
+ "\");");
  +                if (parameters.returnParam != null &&
  +                            parameters.returnParam.getMIMEType() != null) {
  +                    pw.println("        _oper.getReturnParamDesc().setMIMEType(\"" + parameters.returnParam.getMIMEType()
+ "\");");
                   }
   
                   // If we need to know the QName (if we have a namespace or
  @@ -350,17 +355,10 @@
           // in as parameters.
   
           // Call the real implementation
  -        if (parms.returnType == null) {
  +        if (parms.returnParam == null) {
               pw.print("        ");
           } else {
  -            // Construct a Parameter for the return.
  -            // RJB NOTE:  The return info should really just be a
  -            //            Parameter rather than duplicating the same
  -            //            info on the Parameters object.
  -            Parameter returnParm = new Parameter();
  -            returnParm.setMIMEType(parms.returnMIMEType);
  -            returnParm.setType(parms.returnType);
  -            pw.print("        " + Utils.getParameterTypeName(returnParm) + " ret = ");
  +            pw.print("        " + Utils.getParameterTypeName(parms.returnParam) + " ret
= ");
           }
           String call = "impl." + Utils.xmlNameToJava(operation.getName()) + "(";
           boolean needComma = false;
  @@ -376,7 +374,7 @@
           call = call + ")";
           pw.println(call + ";");
   
  -        if (parms.returnType != null) {
  +        if (parms.returnParam != null) {
               pw.println("        return ret;");
           }
           pw.println("    }");
  
  
  
  1.80      +14 -13    xml-axis/java/src/org/apache/axis/wsdl/toJava/JavaStubWriter.java
  
  Index: JavaStubWriter.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/wsdl/toJava/JavaStubWriter.java,v
  retrieving revision 1.79
  retrieving revision 1.80
  diff -u -r1.79 -r1.80
  --- JavaStubWriter.java	2 Aug 2002 12:55:33 -0000	1.79
  +++ JavaStubWriter.java	2 Aug 2002 16:41:41 -0000	1.80
  @@ -333,8 +333,8 @@
           }
           
           // Add the return type
  -        if (params.returnType != null)
  -            v.add(params.returnType);
  +        if (params.returnParam != null)
  +            v.add(params.returnParam.getType());
           
           // Collect all the types in faults
           Map faults = operation.getFaults();
  @@ -542,19 +542,20 @@
               }
           }
           // set output type
  -        if (parms.returnType != null) {
  +        if (parms.returnParam != null) {
  +            TypeEntry returnType = parms.returnParam.getType();
   
               // Get the QName for the return Type
  -            QName returnType = Utils.getXSIType(parms.returnType);
  +            QName returnName = Utils.getXSIType(returnType);
               
               // Get the javaType
  -            String javaType = parms.returnType.getName();
  +            String javaType = returnType.getName();
               if (javaType == null) {
                   pw.println("        _call.setReturnType(" + 
  -                           Utils.getNewQName(returnType) + ");");
  +                           Utils.getNewQName(returnName) + ");");
               } else {
                   pw.println("        _call.setReturnType(" + 
  -                           Utils.getNewQName(returnType) + 
  +                           Utils.getNewQName(returnName) + 
                              "," + javaType + ".class);");
               }
           }
  @@ -692,9 +693,9 @@
           if (allOuts > 0) {
               pw.println("        else {");
               if (allOuts == 1) {
  -                if (parms.returnType != null) {
  -                    writeOutputAssign(pw, "return ", parms.returnType,
  -                            parms.returnMIMEType, "_resp");
  +                if (parms.returnParam != null) {
  +                    writeOutputAssign(pw, "return ", parms.returnParam.getType(),
  +                            parms.returnParam.getMIMEType(), "_resp");
                   }
                   else {
                       // The resp object must go into a holder
  @@ -728,9 +729,9 @@
                                             "_output.get(" + qnameName + ")");
                       }
                   }
  -                if (parms.returnType != null) {
  -                    writeOutputAssign(pw, "return ", parms.returnType,
  -                            parms.returnMIMEType, "_resp");
  +                if (parms.returnParam != null) {
  +                    writeOutputAssign(pw, "return ", parms.returnParam.getType(),
  +                            parms.returnParam.getMIMEType(), "_resp");
                   }
   
               }
  
  
  
  1.34      +8 -13     xml-axis/java/src/org/apache/axis/wsdl/toJava/JavaTestCaseWriter.java
  
  Index: JavaTestCaseWriter.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/wsdl/toJava/JavaTestCaseWriter.java,v
  retrieving revision 1.33
  retrieving revision 1.34
  diff -u -r1.33 -r1.34
  --- JavaTestCaseWriter.java	2 Aug 2002 12:55:34 -0000	1.33
  +++ JavaTestCaseWriter.java	2 Aug 2002 16:41:41 -0000	1.34
  @@ -78,6 +78,7 @@
   import org.apache.axis.wsdl.symbolTable.SchemaUtils;
   import org.apache.axis.wsdl.symbolTable.ServiceEntry;
   import org.apache.axis.wsdl.symbolTable.SymbolTable;
  +import org.apache.axis.wsdl.symbolTable.TypeEntry;
   
   /**
   * This is Wsdl2java's TestCase writer.  It writes the <serviceName>TestCase.java
file.
  @@ -183,21 +184,15 @@
               writeBindingAssignment(pw, bindingType, portName);
   
               pw.println("        try {");
  -            if (params.returnType != null) {
  +            if (params.returnParam != null) {
  +                TypeEntry returnType = params.returnParam.getType();
                   pw.print("            ");
  -                // Construct a Parameter for the return.
  -                // RJB NOTE:  The return info should really just be a
  -                //            Parameter rather than duplicating the same
  -                //            info on the Parameters object.
  -                Parameter returnParm = new Parameter();
  -                returnParm.setMIMEType(params.returnMIMEType);
  -                returnParm.setType(params.returnType);
  -                pw.print(Utils.getParameterTypeName(returnParm));
  +                pw.print(Utils.getParameterTypeName(params.returnParam));
                   pw.print(" value = ");
   
  -                if (params.returnMIMEType == null &&
  -                        Utils.isPrimitiveType(params.returnType)) {
  -                    if ( "boolean".equals( params.returnType.getName() ) ) {
  +                if (params.returnParam.getMIMEType() == null &&
  +                        Utils.isPrimitiveType(returnType)) {
  +                    if ("boolean".equals(returnType.getName())) {
                           pw.println("false;");
                       } else {
                           pw.println("-3;");
  @@ -209,7 +204,7 @@
   
               pw.print("            ");
   
  -            if (params.returnType != null) {
  +            if (params.returnParam != null) {
                   pw.print("value = ");
               }
   
  
  
  

Mime
View raw message