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 gd...@apache.org on 2003/07/13 08:28:58 UTC

cvs commit: xml-axis/java/src/org/apache/axis/wsdl/fromJava Types.java

gdaniels    2003/07/12 23:28:58

  Modified:    java/src/org/apache/axis/description ServiceDesc.java
               java/src/org/apache/axis/i18n resource.properties
               java/src/org/apache/axis/wsdl/fromJava Types.java
  Log:
  Two quick changes.
  
  1) Toss a fault if we try to write out two duplicate schema elements
     (this would be illegal schema).
  
  2) Deal with the case where no return type is specified in a WSDD
     <operation> tag the same way we do params - use the default
     mapping for the appropriate Java type.
  
  Revision  Changes    Path
  1.79      +7 -1      xml-axis/java/src/org/apache/axis/description/ServiceDesc.java
  
  Index: ServiceDesc.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/description/ServiceDesc.java,v
  retrieving revision 1.78
  retrieving revision 1.79
  diff -u -r1.78 -r1.79
  --- ServiceDesc.java	3 Jul 2003 16:58:30 -0000	1.78
  +++ ServiceDesc.java	13 Jul 2003 06:28:57 -0000	1.79
  @@ -699,7 +699,13 @@
           //         a with-conversion match from the target class?  If so,
           //         we'll need to change the logic below.
           if (possibleMatch != null) {
  -            oper.setReturnClass(possibleMatch.getReturnType());
  +            Class returnClass = possibleMatch.getReturnType();
  +            oper.setReturnClass(returnClass);
  +            
  +            QName returnType = oper.getReturnType();
  +            if (returnType == null) {
  +                oper.setReturnType(tm.getTypeQName(returnClass));
  +            }
   
               // Do the faults
               createFaultMetadata(possibleMatch, oper);
  
  
  
  1.62      +3 -1      xml-axis/java/src/org/apache/axis/i18n/resource.properties
  
  Index: resource.properties
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/i18n/resource.properties,v
  retrieving revision 1.61
  retrieving revision 1.62
  diff -u -r1.61 -r1.62
  --- resource.properties	12 Jul 2003 22:13:00 -0000	1.61
  +++ resource.properties	13 Jul 2003 06:28:57 -0000	1.62
  @@ -1153,4 +1153,6 @@
   seqHashMapBadIteratorType01=bad iterator type: {0}
   seqHashMapIllegalStateException00=remove() must follow next()
   seqHashMapArrayIndexOutOfBoundsException01={0} < 0
  -seqHashMapArrayIndexOutOfBoundsException02={0} >= {1}
  \ No newline at end of file
  +seqHashMapArrayIndexOutOfBoundsException02={0} >= {1}>>>>>>> 1.61
  +
  +duplicateSchemaElement=Attempted to write duplicate schema element : {0}
  
  
  
  1.78      +12 -0     xml-axis/java/src/org/apache/axis/wsdl/fromJava/Types.java
  
  Index: Types.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/wsdl/fromJava/Types.java,v
  retrieving revision 1.77
  retrieving revision 1.78
  diff -u -r1.77 -r1.78
  --- Types.java	3 Jul 2003 16:48:23 -0000	1.77
  +++ Types.java	13 Jul 2003 06:28:57 -0000	1.78
  @@ -97,6 +97,8 @@
   import java.util.Iterator;
   import java.util.List;
   import java.util.Map;
  +import java.util.Set;
  +import java.util.HashSet;
   
   /**
    *
  @@ -124,6 +126,9 @@
       List stopClasses = null;
       List beanCompatErrs = new ArrayList();
       ServiceDesc serviceDesc = null;
  +    
  +    /** Keep track of the element QNames we've written to avoid dups */
  +    private Set writtenQNames = new HashSet();
   
       /**
        * This class serailizes a <code>Class</code> to XML Schema. The constructor
  @@ -669,6 +674,12 @@
        */
       public void writeSchemaElement(QName qName, Element element) 
           throws AxisFault {
  +        if (writtenQNames.contains(qName)) {
  +            throw new AxisFault(Constants.FAULT_SERVER_GENERAL,
  +                                Messages.getMessage("duplicateSchemaElement",
  +                                                    qName.toString()),
  +                                null, null);
  +        }
           if (wsdlTypesElem == null) {
               try {
                   writeWsdlTypesElement();
  @@ -714,6 +725,7 @@
               writeTypeNamespace(qName);
           }
           schemaElem.appendChild(element);
  +        writtenQNames.add(qName);
       }
   
       /**