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 bu...@apache.org on 2001/12/06 22:24:14 UTC

cvs commit: xml-axis/java/test/filegen FileGen.wsdl

butek       01/12/06 13:24:14

  Modified:    java/src/org/apache/axis/utils resources.properties
               java/src/org/apache/axis/wsdl SymbolTable.java
               java/test/clash AirportWeather.xml
               java/test/filegen FileGen.wsdl
  Log:
  It is an error if we have references to types that aren't defined.  When I added this
  check I discovered a couple of our WSDL files that had undefined types.
  
  Revision  Changes    Path
  1.26      +1 -0      xml-axis/java/src/org/apache/axis/utils/resources.properties
  
  Index: resources.properties
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/utils/resources.properties,v
  retrieving revision 1.25
  retrieving revision 1.26
  diff -u -r1.25 -r1.26
  --- resources.properties	2001/12/06 17:09:40	1.25
  +++ resources.properties	2001/12/06 21:24:14	1.26
  @@ -573,3 +573,4 @@
   alreadyExists00={0} already exists
   optionDebug00=print debug information
   symbolTable00=Symbol Table
  +undefined00=Type {0} is referenced but not defined.
  
  
  
  1.19      +19 -0     xml-axis/java/src/org/apache/axis/wsdl/SymbolTable.java
  
  Index: SymbolTable.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/wsdl/SymbolTable.java,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- SymbolTable.java	2001/12/06 13:47:32	1.18
  +++ SymbolTable.java	2001/12/06 21:24:14	1.19
  @@ -142,6 +142,7 @@
           checkForUndefined(def);
           populate(def, doc);
           setReferences(def, doc);
  +        checkForUndefined();
       } // add
   
       /**
  @@ -185,6 +186,24 @@
   */
           }
       }
  +
  +    /**
  +     * Scan the symbol table for undefined types and throw an exception.
  +     */
  +    private void checkForUndefined() throws IOException {
  +        Iterator it = symbolTable.values().iterator();
  +        while (it.hasNext()) {
  +            Vector v = (Vector) it.next();
  +            for (int i = 0; i < v.size(); ++i) {
  +                if (v.get(i) instanceof RefdType) {
  +                    throw new IOException(
  +                            JavaUtils.getMessage("undefined00",
  +                            "" + ((RefdType)v.get(i)).getQName()));
  +                }
  +            }
  +        }
  +    } // checkForUndefined
  +
       /**
        * Add the given Definition and Document information to the symbol table (including imported
        * symbols), populating it with SymTabEntries for each of the top-level symbols.
  
  
  
  1.4       +1 -1      xml-axis/java/test/clash/AirportWeather.xml
  
  Index: AirportWeather.xml
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/test/clash/AirportWeather.xml,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- AirportWeather.xml	2001/12/05 18:52:26	1.3
  +++ AirportWeather.xml	2001/12/06 21:24:14	1.4
  @@ -30,7 +30,7 @@
         </xsd:all>
       </xsd:complexType>
   
  -    <xsd:element name="SameForTypeAndElement" ref="SameForTypeAndElement"/>
  +    <xsd:element name="SameForTypeAndElement" ref="xsd1:SameForTypeAndElement"/>
   
     </xsd:schema>
   </types>
  
  
  
  1.3       +2 -1      xml-axis/java/test/filegen/FileGen.wsdl
  
  Index: FileGen.wsdl
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/test/filegen/FileGen.wsdl,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- FileGen.wsdl	2001/11/30 14:59:55	1.2
  +++ FileGen.wsdl	2001/12/06 21:24:14	1.3
  @@ -1,5 +1,6 @@
   <?xml version="1.0" encoding="UTF-8"?>
   <definitions targetNamespace="http://test.com/reference" 
  +    xmlns:tns="http://test.com/reference"
       xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
       xmlns:serviceNS="http://test.com/reference" 
       xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" 
  @@ -26,7 +27,7 @@
               <xsd:element name="streetNum" type="xsd:int"/>
               <xsd:element name="streetName" type="xsd:string"/>
               <xsd:element name="city" type="xsd:string"/>
  -            <xsd:element name="state" type="typens:stateType"/>
  +            <xsd:element name="state" type="tns:stateType"/>
               <xsd:element name="zip" type="xsd:int"/>
           </xsd:all>
         </xsd:complexType>
  
  
  

Re: cvs commit: xml-axis/java/test/filegen FileGen.wsdl

Posted by Neil Patterson <Ne...@zonnet.nl>.
UNSUBSCRIBE

----- Original Message -----
From: <bu...@apache.org>
To: <xm...@apache.org>
Sent: Thursday, December 06, 2001 10:24 PM
Subject: cvs commit: xml-axis/java/test/filegen FileGen.wsdl


> butek       01/12/06 13:24:14
>
>   Modified:    java/src/org/apache/axis/utils resources.properties
>                java/src/org/apache/axis/wsdl SymbolTable.java
>                java/test/clash AirportWeather.xml
>                java/test/filegen FileGen.wsdl
>   Log:
>   It is an error if we have references to types that aren't defined.  When
I added this
>   check I discovered a couple of our WSDL files that had undefined types.
>
>   Revision  Changes    Path
>   1.26      +1 -0
xml-axis/java/src/org/apache/axis/utils/resources.properties
>
>   Index: resources.properties
>   ===================================================================
>   RCS file:
/home/cvs/xml-axis/java/src/org/apache/axis/utils/resources.properties,v
>   retrieving revision 1.25
>   retrieving revision 1.26
>   diff -u -r1.25 -r1.26
>   --- resources.properties 2001/12/06 17:09:40 1.25
>   +++ resources.properties 2001/12/06 21:24:14 1.26
>   @@ -573,3 +573,4 @@
>    alreadyExists00={0} already exists
>    optionDebug00=print debug information
>    symbolTable00=Symbol Table
>   +undefined00=Type {0} is referenced but not defined.
>
>
>
>   1.19      +19 -0
xml-axis/java/src/org/apache/axis/wsdl/SymbolTable.java
>
>   Index: SymbolTable.java
>   ===================================================================
>   RCS file:
/home/cvs/xml-axis/java/src/org/apache/axis/wsdl/SymbolTable.java,v
>   retrieving revision 1.18
>   retrieving revision 1.19
>   diff -u -r1.18 -r1.19
>   --- SymbolTable.java 2001/12/06 13:47:32 1.18
>   +++ SymbolTable.java 2001/12/06 21:24:14 1.19
>   @@ -142,6 +142,7 @@
>            checkForUndefined(def);
>            populate(def, doc);
>            setReferences(def, doc);
>   +        checkForUndefined();
>        } // add
>
>        /**
>   @@ -185,6 +186,24 @@
>    */
>            }
>        }
>   +
>   +    /**
>   +     * Scan the symbol table for undefined types and throw an
exception.
>   +     */
>   +    private void checkForUndefined() throws IOException {
>   +        Iterator it = symbolTable.values().iterator();
>   +        while (it.hasNext()) {
>   +            Vector v = (Vector) it.next();
>   +            for (int i = 0; i < v.size(); ++i) {
>   +                if (v.get(i) instanceof RefdType) {
>   +                    throw new IOException(
>   +                            JavaUtils.getMessage("undefined00",
>   +                            "" + ((RefdType)v.get(i)).getQName()));
>   +                }
>   +            }
>   +        }
>   +    } // checkForUndefined
>   +
>        /**
>         * Add the given Definition and Document information to the symbol
table (including imported
>         * symbols), populating it with SymTabEntries for each of the
top-level symbols.
>
>
>
>   1.4       +1 -1      xml-axis/java/test/clash/AirportWeather.xml
>
>   Index: AirportWeather.xml
>   ===================================================================
>   RCS file: /home/cvs/xml-axis/java/test/clash/AirportWeather.xml,v
>   retrieving revision 1.3
>   retrieving revision 1.4
>   diff -u -r1.3 -r1.4
>   --- AirportWeather.xml 2001/12/05 18:52:26 1.3
>   +++ AirportWeather.xml 2001/12/06 21:24:14 1.4
>   @@ -30,7 +30,7 @@
>          </xsd:all>
>        </xsd:complexType>
>
>   -    <xsd:element name="SameForTypeAndElement"
ref="SameForTypeAndElement"/>
>   +    <xsd:element name="SameForTypeAndElement"
ref="xsd1:SameForTypeAndElement"/>
>
>      </xsd:schema>
>    </types>
>
>
>
>   1.3       +2 -1      xml-axis/java/test/filegen/FileGen.wsdl
>
>   Index: FileGen.wsdl
>   ===================================================================
>   RCS file: /home/cvs/xml-axis/java/test/filegen/FileGen.wsdl,v
>   retrieving revision 1.2
>   retrieving revision 1.3
>   diff -u -r1.2 -r1.3
>   --- FileGen.wsdl 2001/11/30 14:59:55 1.2
>   +++ FileGen.wsdl 2001/12/06 21:24:14 1.3
>   @@ -1,5 +1,6 @@
>    <?xml version="1.0" encoding="UTF-8"?>
>    <definitions targetNamespace="http://test.com/reference"
>   +    xmlns:tns="http://test.com/reference"
>        xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>        xmlns:serviceNS="http://test.com/reference"
>        xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
>   @@ -26,7 +27,7 @@
>                <xsd:element name="streetNum" type="xsd:int"/>
>                <xsd:element name="streetName" type="xsd:string"/>
>                <xsd:element name="city" type="xsd:string"/>
>   -            <xsd:element name="state" type="typens:stateType"/>
>   +            <xsd:element name="state" type="tns:stateType"/>
>                <xsd:element name="zip" type="xsd:int"/>
>            </xsd:all>
>          </xsd:complexType>
>
>
>