axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject cvs commit: ws-axis/java/src/org/apache/axis/wsdl/toJava JavaStubWriter.java
Date Thu, 10 Feb 2005 16:45:16 GMT
dims        2005/02/10 08:45:16

  Modified:    java/src/org/apache/axis/wsdl/toJava JavaStubWriter.java
  Log:
  Patch for public constructor and faults from Jonas team
  
  Revision  Changes    Path
  1.143     +31 -1     ws-axis/java/src/org/apache/axis/wsdl/toJava/JavaStubWriter.java
  
  Index: JavaStubWriter.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/java/src/org/apache/axis/wsdl/toJava/JavaStubWriter.java,v
  retrieving revision 1.142
  retrieving revision 1.143
  diff -u -r1.142 -r1.143
  --- JavaStubWriter.java	8 Feb 2005 18:44:36 -0000	1.142
  +++ JavaStubWriter.java	10 Feb 2005 16:45:16 -0000	1.143
  @@ -110,7 +110,7 @@
        * @param bEntry      
        * @param symbolTable 
        */
  -    protected JavaStubWriter(Emitter emitter, BindingEntry bEntry,
  +    public JavaStubWriter(Emitter emitter, BindingEntry bEntry,
                                SymbolTable symbolTable) {
   
           super(emitter, bEntry.getName() + "Stub", "stub");
  @@ -1099,6 +1099,7 @@
           if (oneway) {
               pw.print("        _call.invokeOneWay(");
           } else {
  +            pw.print(" try {");
               pw.print("        java.lang.Object _resp = _call.invoke(");
           }
   
  @@ -1227,6 +1228,35 @@
           } else {
               pw.println("        extractAttachments(_call);");
           }
  +        // End catch
  +        // Get faults
  +        Map faults = parms.faults;
  +        // Get fauls of signature
  +        String[] throwsSig = parms.signature.split("throws");
  +        List exceptionsThrowsList = new ArrayList();
  +        if (throwsSig != null && throwsSig.length > 1) {
  +            String[] thrExcep = throwsSig[1].split(",");
  +            for (int i = 0; i < thrExcep.length; i++) {
  +                exceptionsThrowsList.add(thrExcep[i]);
  +            }
  +        }
  +        pw
  +                .println("  } catch (org.apache.axis.AxisFault axisFaultException) {");
  +        if (faults != null && faults.size() > 0) {
  +            pw.println("    if (axisFaultException.detail != null) {");
  +            for (Iterator faultIt = exceptionsThrowsList.iterator(); faultIt
  +                    .hasNext();) {
  +                String exceptionFullName = (String) faultIt.next();
  +                pw.println("        if (axisFaultException.detail instanceof "
  +                        + exceptionFullName + ") {");
  +                pw.println("              throw (" + exceptionFullName
  +                        + ") axisFaultException.detail;");
  +                pw.println("         }");
  +            }
  +            pw.println("   }");
  +        }
  +        pw.println("  throw axisFaultException;");
  +        pw.println("}");
       }    // writeResponseHandling
   
       /**
  
  
  

Mime
View raw message