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 di...@apache.org on 2003/12/19 16:01:38 UTC

cvs commit: ws-axis/java/src/org/apache/axis/i18n resource.properties

dims        2003/12/19 07:01:38

  Modified:    java/src/org/apache/axis/wsdl/toJava JavaStubWriter.java
               java/src/org/apache/axis/i18n resource.properties
  Log:
  Added warning if there are no parts in the message. (See Sam's WSDL at http://intertwingly.net/stories/2003/12/18/AtomAPI.wsdl)
  
  Revision  Changes    Path
  1.126     +15 -5     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.125
  retrieving revision 1.126
  diff -u -r1.125 -r1.126
  --- JavaStubWriter.java	12 Dec 2003 16:58:12 -0000	1.125
  +++ JavaStubWriter.java	19 Dec 2003 15:01:38 -0000	1.126
  @@ -55,6 +55,7 @@
   package org.apache.axis.wsdl.toJava;
   
   import org.apache.axis.Constants;
  +import org.apache.axis.components.logger.LogFactory;
   import org.apache.axis.enum.Style;
   import org.apache.axis.enum.Use;
   import org.apache.axis.utils.JavaUtils;
  @@ -69,6 +70,7 @@
   import org.apache.axis.wsdl.symbolTable.SymbolTable;
   import org.apache.axis.wsdl.symbolTable.TypeEntry;
   import org.apache.axis.wsdl.symbolTable.DefinedType;
  +import org.apache.commons.logging.Log;
   
   import javax.wsdl.Binding;
   import javax.wsdl.BindingOperation;
  @@ -99,6 +101,9 @@
    */
   public class JavaStubWriter extends JavaClassWriter {
   
  +    /** Field log */
  +    protected static Log log = LogFactory.getLog(JavaStubWriter.class.getName());
  +    
       /** Field bEntry */
       private BindingEntry bEntry;
   
  @@ -1090,11 +1095,16 @@
               // element.
               Map partsMap =
                       operation.getOperation().getInput().getMessage().getParts();
  -            Part p = (Part) partsMap.values().iterator().next();
  -            QName q = p.getElementName();
  -
  -            pw.println("        _call.setOperationName(" + Utils.getNewQName(q)
  -                    + ");");
  +            Iterator i = partsMap.values().iterator();
  +            if(i.hasNext()) {
  +                Part p = (Part) partsMap.values().iterator().next();
  +                QName q = p.getElementName();
  +    
  +                pw.println("        _call.setOperationName(" + Utils.getNewQName(q)
  +                        + ");");
  +            } else {
  +                log.warn(Messages.getMessage("missingPartsForMessage00",operation.getOperation().getInput().getMessage().getQName().toString())); 
  +            }
           } else {
               QName elementQName = Utils.getOperationQName(operation, bEntry,
                       symbolTable);
  
  
  
  1.78      +1 -0      ws-axis/java/src/org/apache/axis/i18n/resource.properties
  
  Index: resource.properties
  ===================================================================
  RCS file: /home/cvs/ws-axis/java/src/org/apache/axis/i18n/resource.properties,v
  retrieving revision 1.77
  retrieving revision 1.78
  diff -u -r1.77 -r1.78
  --- resource.properties	3 Dec 2003 17:19:19 -0000	1.77
  +++ resource.properties	19 Dec 2003 15:01:38 -0000	1.78
  @@ -967,6 +967,7 @@
   beanCompatPkg00=The class {0} is defined in a java or javax package and cannot be converted into an xml schema type.  An xml schema anyType will be used to define this class in the wsdl file.
   beanCompatConstructor00=The class {0} does not contain a default constructor, which is a requirement for a bean class.  The class cannot be converted into an xml schema type.  An xml schema anyType will be used to define this class in the wsdl file.
   badNamespaceForOperation00=soap:body in Binding {0} / Operation {1} has an empty namespace
  +missingPartsForMessage00=Message {0} has no parts
   
   unsupportedSchemaType00=The XML Schema type ''{0}'' is not currently supported.
   optionNoWrap00=turn off support for "wrapped" document/literal