axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject cvs commit: xml-axis/java/test/wsdl Wsdl2javaTestSuite.xml
Date Fri, 26 Jul 2002 15:48:28 GMT
dims        2002/07/26 08:48:28

  Modified:    java/src/org/apache/axis/wsdl/symbolTable SymbolTable.java
               java/test/wsdl Wsdl2javaTestSuite.xml
  Added:       java/test/wsdl/import3/MultiImpIncl/tbl1 aritem.xsd
               java/test/wsdl/import3/MultiImpIncl AxsGlobals.xsd
                        CompoGlobals.xsd
               java/test/wsdl/import3/MultiImpIncl/tbl2 coarignx.xsd
               java/test/wsdl/import3/MultiImpIncl/cmp comp.xsd
               java/test/wsdl/import3/MultiImpIncl/includes include.xsd
               java/test/wsdl/import3/MultiImpIncl/wsdl MultiImp.wsdl
               java/test/wsdl/import3 session.xsd
               java/src/org/apache/axis/utils URLHashSet.java
  Log:
  - Fix for Bug 10612 - AXIS doesn't support xml includes
  - Added a test case too.
  
  Notes:
  - We were not supporting xsd references relative to the wsdl file properly.
  - When url's have ".." and "." etc, we need to clean them up to make sure that the same
file is not added twice.
  
  Revision  Changes    Path
  1.1                  xml-axis/java/test/wsdl/import3/MultiImpIncl/tbl1/aritem.xsd
  
  Index: aritem.xsd
  ===================================================================
  <?xml version="1.0" encoding="UTF-8"?> 
  <schema 
    targetNamespace="http://www.axsone.com/webdemo/exec/schemas/tbl1/aritem" 
    xmlns:tns="http://www.axsone.com/webdemo/exec/schemas/tbl1/aritem" 
    xmlns="http://www.w3.org/2001/XMLSchema"
    xmlns:axs="http://www.axsone.com/webdemo/exec/schemas/AxsGlobals">
     
   <!--  cannot use import, bug in AXIS - does not allow to import already
         imported document when used with include. It was imported in CompoGlobals.xsd	
         
         Workaround: to comment out this import statement
     
    -->  
    <import
      namespace="http://www.axsone.com/webdemo/exec/schemas/AxsGlobals"
      schemaLocation="../AxsGlobals.xsd"/>
  
    
    <complexType name="AritemAllFieldsType"> 
      <all> 
        <element name="CUSTID" type="string" minOccurs="0"/> 
        <element name="COMPNUM" type="string" minOccurs="0"/> 
        <element name="ARIGLBNM" type="decimal" minOccurs="0"/> 
        <element name="ARNOTYPE" type="string" minOccurs="0"/> 
        <element name="ITMNUM" type="string" minOccurs="0"/> 
        <element name="COMPNUM2" type="string" minOccurs="0"/> 
        <element name="ARICNKEY" type="string" minOccurs="0"/> 
        <element name="ARICNKY2" type="string" minOccurs="0"/> 
        <element name="DUECCDT" type="date" minOccurs="0"/>  
        </all> 
    </complexType> 
   
    <complexType name="CUSTOMER_HKEYFieldsType"> 
      <complexContent> 
        <restriction base="tns:AritemAllFieldsType"> 
          <all> 
            <element name="CUSTID" type="string" minOccurs="0"/> 
            <element name="COMPNUM" type="string" minOccurs="0"/> 
            <element name="ARIGLBNM" type="decimal" minOccurs="0"/> 
          </all> 
        </restriction> 
      </complexContent> 
    </complexType> 
    
    <complexType name="NUMBER_HKEYFieldsType"> 
      <complexContent> 
        <restriction base="tns:AritemAllFieldsType"> 
          <all> 
            <element name="ARNOTYPE" type="string" minOccurs="0"/> 
            <element name="ITMNUM" type="string" minOccurs="0"/> 
            <element name="COMPNUM2" type="string" minOccurs="0"/> 
          </all> 
        </restriction> 
      </complexContent> 
    </complexType> 
    
    <complexType name="AritemForType"> 
      <choice> 
        <element name="Key0_CUSTOMER_HKEY"> 
          <complexType> 
            <all> 
              <element name="from" type="tns:CUSTOMER_HKEYFieldsType" minOccurs="0"/>

              <element name="to" type="tns:CUSTOMER_HKEYFieldsType" minOccurs="0"/>

            </all> 
          </complexType> 
        </element> 
        <element name="Key1_NUMBER_HKEY"> 
          <complexType> 
            <all> 
              <element name="from" type="tns:NUMBER_HKEYFieldsType" minOccurs="0"/>

              <element name="to" type="tns:NUMBER_HKEYFieldsType" minOccurs="0"/> 
            </all> 
          </complexType> 
        </element> 
      </choice> 
    </complexType> 
   
    <complexType name="AritemForOneType"> 
      <choice> 
        <element name="Key0_CUSTOMER_HKEY" type="tns:CUSTOMER_HKEYFieldsType"/> 
        <element name="Key1_NUMBER_HKEY" type="tns:NUMBER_HKEYFieldsType"/> 
      </choice> 
    </complexType> 
   
    <complexType name="AritemWhereType"> 
      <all> 
        <element name="from" type="tns:AritemAllFieldsType" minOccurs="0"/> 
        <element name="to" type="tns:AritemAllFieldsType" minOccurs="0"/> 
        <element name="criteria" type="string" minOccurs="0"/> 
      </all> 
    </complexType> 
    
    <complexType name="AritemSortbyType"> 
      <complexContent> 
        <extension base="tns:AritemAllFieldsType"> 
          <all> 
          </all> 
         <attribute name="direction" type="axs:SortDirectionType"/> 
        </extension> 
      </complexContent> 
    </complexType> 
  </schema> 
  
  
  
  1.1                  xml-axis/java/test/wsdl/import3/MultiImpIncl/AxsGlobals.xsd
  
  Index: AxsGlobals.xsd
  ===================================================================
  <?xml version="1.0" encoding="UTF-8"?>
  <schema
    targetNamespace="http://www.axsone.com/webdemo/exec/schemas/AxsGlobals"
    xmlns:tns="http://www.axsone.com/webdemo/exec/schemas/AxsGlobals"
    xmlns="http://www.w3.org/2001/XMLSchema">
  
    <complexType name="UserContextType">
      <sequence>
        <element name="SYS_USER" minOccurs="0"/>
        <element name="GROUP_ID" minOccurs="0"/>
        <element name="DBMAP" minOccurs="0"/>
        <element name="ENTITY" type="string" minOccurs="0"/>
      </sequence>
    </complexType>
  
    <complexType name="UserRequestType">
      <complexContent>
        <extension base="tns:UserContextType">
          <sequence>
            <element name="HOST_USER" type="string" minOccurs="0"/>
            <element name="HOST_PWD" type="string" minOccurs="0"/>
          </sequence>
        </extension>
      </complexContent>
    </complexType>
  
    <complexType name="UserResponseType">
      <complexContent>
        <extension base="tns:UserContextType">
          <sequence>
          </sequence>
        </extension>
      </complexContent>
    </complexType>
    
    <simpleType name="positiveInteger">
      <restriction base="integer">
      </restriction> 	
    </simpleType>
    
    <simpleType name="nonNegativeInteger">
        <restriction base="integer">
        </restriction> 	
    </simpleType>
    
    <simpleType name="SortDirectionType">
      <restriction base="string">
        <enumeration value="ASCENDING"/>
        <enumeration value="DESCENDING"/>
      </restriction>
    </simpleType>
     
   </schema>
  
  
  
  1.1                  xml-axis/java/test/wsdl/import3/MultiImpIncl/CompoGlobals.xsd
  
  Index: CompoGlobals.xsd
  ===================================================================
  <?xml version="1.0" encoding="UTF-8"?>
  <schema 
    targetNamespace="http://www.axsone.com/webdemo/exec/schemas/CompoGlobals"
    xmlns:tns="http://www.axsone.com/webdemo/exec/schemas/CompoGlobals"
    xmlns="http://www.w3.org/2001/XMLSchema"
    xmlns:axs="http://www.axsone.com/webdemo/exec/schemas/AxsGlobals">
  
    <import
      namespace="http://www.axsone.com/webdemo/exec/schemas/AxsGlobals"
      schemaLocation="../AxsGlobals.xsd"/>
  
   
    <simpleType name="DocActions">
      <restriction base="string">
        <enumeration value="VALIDT"/>
        <enumeration value="PROCES"/>
        <enumeration value="VALIDH"/>
        <enumeration value="DELETE"/>
        <enumeration value="UPDATE"/>
        <enumeration value="PREADD"/>
        <enumeration value="PREDEL"/>
        <enumeration value="INIT"/>
      </restriction>
    </simpleType>
  
    <simpleType name="DocRowType">
      <restriction base="string">
        <enumeration value="All"/>
        <enumeration value="Header"/>
        <enumeration value="Line"/>
      </restriction>
    </simpleType>
  
    <simpleType name="RawDataIndicatorType">
      <restriction base="string">
        <enumeration value="X"/>
        <enumeration value="C"/>
        <enumeration value="K"/>
        <enumeration value="I"/>
        <enumeration value="F"/>
        <enumeration value="D"/>
        <enumeration value="Y"/>
        <enumeration value="S"/>
      </restriction>
    </simpleType>
  
    <simpleType name="YesNoSpaceType">
      <restriction base="string">
        <enumeration value="Y"/>
        <enumeration value="N"/>
        <enumeration value=" "/>
      </restriction>
    </simpleType>
  
    <simpleType name="RowsRequestedType">
      <restriction base="axs:positiveInteger"> 
      </restriction>
    </simpleType>
  
    <complexType name="AllRequestsType">
      <all>
        <element name="user_context" type="axs:UserRequestType" minOccurs="0"/>
        <element name="rows_requested" type="tns:RowsRequestedType" minOccurs="0"/>
        <element name="raw_data_indicator" type="tns:RawDataIndicatorType" minOccurs="0"/>
        <element name="completion_indication" type="tns:YesNoSpaceType" minOccurs="0"/>
        <element name="form_name" type="string" minOccurs="0"/>
        <element name="caller_id" type="string" minOccurs="0"/>
        <element name="item_number" type="axs:nonNegativeInteger" minOccurs="0"/> 
        <element name="ticket_id" type="string" minOccurs="0"/>
      </all>
    </complexType>
  
    <complexType name="AllResponsesType">
      <sequence>
        <element name="user_context" type="axs:UserResponseType"/>
        <element name="server_version" type="string"/>
        <element name="client_version" type="string"/>
        <element name="completion_indication" type="tns:YesNoSpaceType"/>
        <element name="form_name" type="string" minOccurs="0"/>
        <element name="buffer_format_rows_in_buffer" type="axs:nonNegativeInteger"/>
      </sequence>
    </complexType>
  
    <complexType name="DataRequestType">
      <sequence>
        <element name="request" type="tns:AllRequestsType"/>
        <element name="action_type" type="tns:DocActions"/>
      </sequence>
    </complexType>
  
    <complexType name="DataResponseType">
      <complexContent>
        <extension base="tns:AllResponsesType">
          <sequence>
            <element name="action_type" type="tns:DocActions"/>
  	</sequence>
        </extension>
      </complexContent>
    </complexType>
  </schema>
  
  
  1.1                  xml-axis/java/test/wsdl/import3/MultiImpIncl/tbl2/coarignx.xsd
  
  Index: coarignx.xsd
  ===================================================================
  <?xml version="1.0" encoding="UTF-8"?> 
  <schema 
    targetNamespace="http://www.axsone.com/webdemo/exec/schemas/tbl2/coarignx" 
    xmlns:tns="http://www.axsone.com/webdemo/exec/schemas/tbl2/coarignx" 
    xmlns="http://www.w3.org/2001/XMLSchema" 
    xmlns:axs="http://www.axsone.com/webdemo/exec/schemas/AxsGlobals">
   
    <!--  cannot use import, bug in AXIS, this file was already imported.
    	Workaround: to comment out import statement 
     -->	
     <import
       namespace="http://www.axsone.com/webdemo/exec/schemas/AxsGlobals"
       schemaLocation="../AxsGlobals.xsd"/>
  
    <complexType name="CoarignxAllFieldsType"> 
      <all> 
        <element name="COMPNUM2" type="string" minOccurs="0"/> 
        <element name="CUSTID" type="string" minOccurs="0"/> 
        <element name="LOCATION" type="string" minOccurs="0"/> 
        <element name="ITMNUM" type="decimal" minOccurs="0"/> 
        <element name="CURXRATE" type="decimal" minOccurs="0"/> 
        <element name="ITEMCCDT" type="date" minOccurs="0"/> 
      </all> 
    </complexType> 
   
  </schema> 
  
  
  
  1.1                  xml-axis/java/test/wsdl/import3/MultiImpIncl/cmp/comp.xsd
  
  Index: comp.xsd
  ===================================================================
  <?xml version="1.0" encoding="UTF-8"?> 
  <schema 
    targetNamespace="http://www.axsone.com/webdemo/exec/schemas/cmp/comp" 
    xmlns:tns="http://www.axsone.com/webdemo/exec/schemas/cmp/comp" 
    xmlns:glb="http://www.axsone.com/webdemo/exec/schemas/CompoGlobals" 
    xmlns:tbl01="http://www.axsone.com/webdemo/exec/schemas/tbl1/aritem" 
    xmlns:tbl02="http://www.axsone.com/webdemo/exec/schemas/tbl2/coarignx" 
    xmlns="http://www.w3.org/2001/XMLSchema"> 
   
    <import 
      namespace="http://www.axsone.com/webdemo/exec/schemas/CompoGlobals" 
      schemaLocation="../CompoGlobals.xsd"/> 
  
   
    <include schemaLocation="../includes/include.xsd"/>  
   
    <complexType name="letType"> 
      <all> 
        <element name="customer_id" type="string" minOccurs="0"/> 
        <element name="trans_type_id" type="string" minOccurs="0"/> 
        <element name="num_items_created" type="decimal" minOccurs="0"/> 
      </all> 
    </complexType> 
   
    <attribute name="rowType" type="glb:DocRowType"/> 
   
    <element name="DataRequest"> 
      <complexType> 
        <complexContent> 
          <extension base="glb:DataRequestType"> 
            <sequence> 
              <element name="transaction"> 
                <complexType> 
                  <choice> 
                    <element ref="tns:ViewCOARIGNX_Transaction"/> 
                  </choice> 
                </complexType> 
              </element> 
            </sequence> 
          </extension> 
        </complexContent> 
      </complexType> 
    </element> 
   
    <element name="DataRequestResponse"> 
      <complexType> 
        <complexContent> 
          <extension base="glb:DataResponseType"> 
            <sequence> 
              <element name="rows"> 
                <complexType> 
                  <choice> 
                    <element ref="tns:ViewCOARIGNX_VIEW_FOR_ITEM_UPDATE_COMPONENTRows"/>

                  </choice> 
                </complexType> 
              </element> 
            </sequence> 
          </extension> 
        </complexContent> 
      </complexType> 
    </element> 
  </schema> 
  
  
  
  1.1                  xml-axis/java/test/wsdl/import3/MultiImpIncl/includes/include.xsd
  
  Index: include.xsd
  ===================================================================
  <?xml version="1.0" encoding="UTF-8"?> 
  <schema 
    targetNamespace="http://www.axsone.com/webdemo/exec/schemas/cmp/comp" 
    xmlns:tns="http://www.axsone.com/webdemo/exec/schemas/cmp/comp" 
    xmlns:tbl01="http://www.axsone.com/webdemo/exec/schemas/tbl1/aritem" 
    xmlns:tbl02="http://www.axsone.com/webdemo/exec/schemas/tbl2/coarignx" 
    xmlns="http://www.w3.org/2001/XMLSchema"> 
   
    <import 
      namespace="http://www.axsone.com/webdemo/exec/schemas/tbl1/aritem" 
      schemaLocation="../tbl1/aritem.xsd"/> 
    <import 
      namespace="http://www.axsone.com/webdemo/exec/schemas/tbl2/coarignx" 
      schemaLocation="../tbl2/coarignx.xsd"/> 
   
    
       <complexType name="OneRowType"> 
         <all> 
           <element name="ARITEM" type="tbl01:AritemAllFieldsType" minOccurs="0"/> 
           <element name="COARIGNX" type="tbl02:CoarignxAllFieldsType" minOccurs="0"/>

         </all> 
         <attribute ref="tns:rowType" use="optional" default="All"/> 
       </complexType> 
      
       <complexType name="MultiRowType"> 
         <sequence> 
           <element name="row" type="tns:OneRowType" minOccurs="0" maxOccurs="unbounded"/>

         </sequence> 
       </complexType> 
      
       <element name="ViewCOARIGNX_Transaction"> 
         <complexType> 
           <sequence> 
             <element name="let" type="tns:letType" minOccurs="0"/> 
             <element name="input_rows" type="tns:MultiRowType" minOccurs="0"/> 
             <element name="return" type="tns:MultiRowType"/> 
           </sequence> 
         </complexType> 
       </element> 
      
       <element name="ViewCOARIGNX_VIEW_FOR_ITEM_UPDATE_COMPONENTRows" type="tns:MultiRowType"/>

  
  <!-- 
    <complexType name="OneRowType"> 
      <all> 
        <element name="ARITEM" type="tbl01:AllFieldsType" minOccurs="0"/> 
        <element name="COARIGNX" type="tbl02:AllFieldsType" minOccurs="0"/> 
      </all> 
      <attribute ref="tns:rowType" use="optional" default="All"/> 
    </complexType> 
   
    <complexType name="MultiRowType"> 
      <sequence> 
        <element name="row" type="tns:OneRowType" minOccurs="0" maxOccurs="unbounded"/>

      </sequence> 
    </complexType> 
   
    <element name="ViewCOARIGNX_VIEW_FOR_ITEM_UPDATE_COMPONENTTransaction"> 
      <complexType> 
        <sequence> 
          <element name="let" type="tns:letType" minOccurs="0"/> 
          <element name="input_rows" type="tns:MultiRowType" minOccurs="0"/> 
          <element name="return" type="tns:MultiRowType"/> 
        </sequence> 
      </complexType> 
    </element> 
   
    <element name="ViewCOARIGNX_VIEW_FOR_ITEM_UPDATE_COMPONENTRows" type="tns:MultiRowType"/>

    
  -->  
    
    
  </schema> 
  
  
  
  1.1                  xml-axis/java/test/wsdl/import3/MultiImpIncl/wsdl/MultiImp.wsdl
  
  Index: MultiImp.wsdl
  ===================================================================
  <?xml version="1.0"?>
  <definitions name="coarignxDataService"
    targetNamespace="http://www.axsone.com/webdemo/exec/schemas/multiImpInclDataService"
    xmlns:tns="http://www.axsone.com/webdemo/exec/schemas/multiImpInclDataService"
    xmlns="http://schemas.xmlsoap.org/wsdl/"
    xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
    xmlns:cmp="http://www.axsone.com/webdemo/exec/schemas/cmp/comp"
    xmlns:ses="http://www.axsone.com/webdemo/exec/schemas/session">
  
    <import
      namespace="http://www.axsone.com/webdemo/exec/schemas/cmp/comp"
      location="../cmp/comp.xsd"/>
  
    <import
      namespace="http://www.axsone.com/webdemo/exec/schemas/session"
      location="../../session.xsd"/>
  
    <message name="DataRequestMessage">
      <part name="header" element="ses:Session"/>
      <part name="body" element="cmp:DataRequest"/>
    </message>
  
    <message name="DataResponseMessage">
      <part name="header" element="ses:Session"/>
      <part name="body" element="cmp:DataRequestResponse"/>
    </message>
  
    <portType name="multiImpInclDataPortType">
      <operation name="DataOperation">
        <input message="tns:DataRequestMessage"/>
        <output message="tns:DataResponseMessage"/>
      </operation>
    </portType>
  
    <binding name="multiImpInclDataBinding" type="tns:multiImpInclDataPortType">
      <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
      <operation name="DataOperation">
        <soap:operation soapAction="http://www.axsone.com/webdemo/exec/schemas/cmp/comp"/>
        <input>
          <soap:header part="header" use="literal"/>
          <soap:body parts="body" use="literal"/>
        </input>
        <output>
          <soap:header part="header" use="literal"/>
          <soap:body parts="body" use="literal"/>
        </output>
      </operation>
    </binding>  
  
    <service name="multiImpInclService">
      <port name="multiImpInclPort" binding="tns:multiImpInclDataBinding">
        <soap:address location="http://www.axsone.com/blahblahblah"/>
      </port>
    </service>
  </definitions>
  
  
  
  
  1.1                  xml-axis/java/test/wsdl/import3/session.xsd
  
  Index: session.xsd
  ===================================================================
  <?xml version="1.0" encoding="UTF-8"?>
  <schema
    targetNamespace="http://www.axsone.com/webdemo/exec/schemas/session"
    xmlns:tns="http://www.axsone.com/webdemo/exec/schemas/session"
    xmlns="http://www.w3.org/2001/XMLSchema">
  
    <annotation>
      <documentation xml:lang="en">
        Session info type definition for AXS-One financial Web Services.
        Copyright 2001 AXS-One Inc. All rights reserved.
      </documentation>
    </annotation>
  
    <element name="Session">
      <complexType>
        <all>
          <element name="SessionId" type="string" minOccurs="0"/>
          <element name="ServerId" type="string" minOccurs="0"/>
          <element name="MaintainState" type="boolean" minOccurs="0"/>
        </all>
      </complexType>
    </element>
  </schema>
  
  
  1.15      +10 -3     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.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- SymbolTable.java	24 Jul 2002 16:15:04 -0000	1.14
  +++ SymbolTable.java	26 Jul 2002 15:48:27 -0000	1.15
  @@ -107,6 +107,7 @@
   
   import org.apache.axis.utils.JavaUtils;
   import org.apache.axis.utils.XMLUtils;
  +import org.apache.axis.utils.URLHashSet;
   
   import org.apache.axis.wsdl.gen.Generator;
   
  @@ -352,6 +353,13 @@
               throw new IOException(JavaUtils.getMessage("cantGetDoc00", uri));
           }
           this.wsdlURI = uri;
  +        try {
  +            File f = new File(uri);
  +            if(f.exists()){
  +                uri = f.toURL().toString();
  +            }
  +        } catch (Exception e){
  +        }
           populate(uri, doc);
       } // populate
   
  @@ -478,7 +486,7 @@
        * has the problem.  If we're on the primary WSDL file, then we don't know the name
and
        * filename will be null.  But we know the names of all imported files.
        */
  -    private HashSet importedFiles = new HashSet();
  +    private URLHashSet importedFiles = new URLHashSet();
       private void populate(URL context, Definition def, Document doc,
               String filename) throws IOException {
           if (doc != null) {
  @@ -560,7 +568,7 @@
               String contextFileName = contextURL.getFile();
               String parentName = new File(contextFileName).getParent();
               if (parentName != null) {
  -                return new URL("file", "",  parentName + "/" + path);
  +                return URLHashSet.normalize(new URL("file", "",  parentName + "/" + path));
               } 
           }
           return new URL("file", "", path);
  @@ -1921,5 +1929,4 @@
                       JavaUtils.getMessage("alreadyExists00", "" + name));
           }
       } // symbolTablePut
  -
   } // class SymbolTable
  
  
  
  1.1                  xml-axis/java/src/org/apache/axis/utils/URLHashSet.java
  
  Index: URLHashSet.java
  ===================================================================
  /*
   * The Apache Software License, Version 1.1
   *
   *
   * Copyright (c) 2001 The Apache Software Foundation.  All rights
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer.
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in
   *    the documentation and/or other materials provided with the
   *    distribution.
   *
   * 3. The end-user documentation included with the redistribution,
   *    if any, must include the following acknowledgment:
   *       "This product includes software developed by the
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowledgment may appear in the software itself,
   *    if and wherever such third-party acknowledgments normally appear.
   *
   * 4. The names "Axis" and "Apache Software Foundation" must
   *    not be used to endorse or promote products derived from this
   *    software without prior written permission. For written
   *    permission, please contact apache@apache.org.
   *
   * 5. Products derived from this software may not be called "Apache",
   *    nor may "Apache" appear in their name, without prior written
   *    permission of the Apache Software Foundation.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation.  For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   */
  package org.apache.axis.utils;
  
  import java.io.File;
  import java.net.URL;
  import java.util.HashSet;
  import java.util.StringTokenizer;
  
  /**
   * Class URLHashSet
   *
   * @author Davanum Srinivas (dims@apache.org)
   */
  public class URLHashSet extends HashSet {
  
      /**
       * Adds the specified URL to this set if it is not already present.
       *
       * @param url url to be added to this set.
       * @return true if the set did not already contain the specified element.
       */
      public boolean add(URL url) {
          return super.add(normalize(url));
      }
  
      /**
       * Removes the given URL from this set if it is present.
       *
       * @param url url to be removed from this set, if present.
       * @return true if the set contained the specified element.
       */
      public boolean remove(URL url) {
          return super.remove(normalize(url));
      }
  
      /**
       * Returns true if this set contains the specified element.
       *
       * @param url url whose presence in this set is to be tested.
       * @return true if this set contains the specified element.
       */
      public boolean contains(URL url) {
          return super.contains(normalize(url));
      }
  
      /**
       * if the url points to a file then make sure we cleanup ".." "." etc.
       *
       * @param url url to be normalized
       * @return normalized url
       */
      public static URL normalize(URL url) {
          if (url.getProtocol().equals("file")) {
              File f = new File(cleanup(url.toString().substring(5)));// 5 == "file:".length()
              try {
                  return f.toURL();
              } catch (Exception e) {}
          }
          return url;
      }
  
      /**
       * Normalize a uri containing ../ and ./ paths.
       *
       * @param uri The uri path to normalize
       * @return The normalized uri
       */
      private static String cleanup(String uri) {
          String[] dirty = tokenize(uri, "/\\", false);
          int length = dirty.length;
          String[] clean = new String[length];
          boolean path;
          boolean finished;
  
          while (true) {
              path = false;
              finished = true;
              for (int i = 0, j = 0; (i < length) && (dirty[i] != null); i++) {
                  if (".".equals(dirty[i])) {
                      // ignore
                  } else if ("..".equals(dirty[i])) {
                      clean[j++] = dirty[i];
                      if (path) {
                          finished = false;
                      }
                  } else {
                      if ((i + 1 < length) && ("..".equals(dirty[i + 1]))) {
                          i++;
                      } else {
                          clean[j++] = dirty[i];
                          path = true;
                      }
                  }
              }
              if (finished) {
                  break;
              } else {
                  dirty = clean;
                  clean = new String[length];
              }
          }
          StringBuffer b = new StringBuffer(uri.length());
  
          for (int i = 0; (i < length) && (clean[i] != null); i++) {
              b.append(clean[i]);
              if ((i + 1 < length) && (clean[i + 1] != null)) {
                  b.append("/");
              }
          }
          return b.toString();
      }
  
      /**
       * Constructs a string tokenizer for the specified string. All characters
       * in the delim argument are the delimiters for separating tokens.
       * If the returnTokens flag is true, then the delimiter characters are
       * also returned as tokens. Each delimiter is returned as a string of
       * length one. If the flag is false, the delimiter characters are skipped
       * and only serve as separators between tokens. Then tokenizes the str
       * and return an String[] array with tokens.
       *
       * @param str           a string to be parsed
       * @param delim         the delimiters
       * @param returnTokens  flag indicating whether to return the delimiters
       *                      as tokens
       *
       * @return array with tokens
       */
      private static String[] tokenize(String str, String delim, boolean returnTokens) {
          StringTokenizer tokenizer = new StringTokenizer(str, delim, returnTokens);
          String[] tokens = new String[tokenizer.countTokens()];
          int i = 0;
          while (tokenizer.hasMoreTokens()) {
              tokens[i] = tokenizer.nextToken();
              i++;
          }
          return tokens;
      }
  }
  
  
  
  1.118     +19 -7     xml-axis/java/test/wsdl/Wsdl2javaTestSuite.xml
  
  Index: Wsdl2javaTestSuite.xml
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/test/wsdl/Wsdl2javaTestSuite.xml,v
  retrieving revision 1.117
  retrieving revision 1.118
  diff -u -r1.117 -r1.118
  --- Wsdl2javaTestSuite.xml	24 Jul 2002 16:15:05 -0000	1.117
  +++ Wsdl2javaTestSuite.xml	26 Jul 2002 15:48:28 -0000	1.118
  @@ -205,9 +205,9 @@
       </javac>
   
   
  -    <!-- The following invocation of java2wsdl simply tests whether the 
  +    <!-- The following invocation of java2wsdl simply tests whether the
            split wsdl function works.  The generated wsdl files are not used. -->
  -    
  +
       <java2wsdl output="build/work/test/wsdl/roundtrip/RoundtripIntf.wsdl"
                  outputImpl="build/work/test/wsdl/roundtrip/RoundtripImpl.wsdl"
                  className= "test.wsdl.roundtrip.RoundtripPortType"
  @@ -948,8 +948,8 @@
                  testcase="no">
           <mapping namespace="urn:attributeQualify" package="test.wsdl.qualify2"/>
       </wsdl2java>
  -    
  -    
  +
  +
       <!-- This tests Bug 9642 -  Java Date not deserialize properly.  -->
       <wsdl2java url="test/wsdl/ram/ram.wsdl"
                  output="build/work"
  @@ -974,9 +974,21 @@
                  serverSide="yes"
                  testcase="no">
       </wsdl2java>
  -    
  -    
  -    
  +
  +    <!-- jaxrpc sample -->
  +    <wsdl2java url="samples/jaxrpc/hello/HelloWorld.wsdl"
  +               output="build/work"
  +               serverSide="yes"
  +               testcase="no">
  +    </wsdl2java>
  +
  +    <!-- Testcase for Bug 10612 - AXIS doesn't support xml includes -->
  +    <wsdl2java url="test/wsdl/import3/MultiImpIncl/wsdl/MultiImp.wsdl"
  +               output="build/work"
  +               serverSide="yes"
  +               testcase="no">
  +    </wsdl2java>
  +
       <!-- The following WSDL are BAD.  We're keeping them here so we can -->
       <!-- check periodically to see whether the owner has fixed them.    -->
   
  
  
  

Mime
View raw message