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/src/org/apache/axis/wsdl/toJava JavaBeanWriter.java
Date Mon, 23 Sep 2002 19:24:40 GMT
dims        2002/09/23 12:24:40

  Modified:    java/test/wsdl/types ComprehensiveTypes.wsdl
               java/src/org/apache/axis/wsdl/toJava JavaBeanWriter.java
  Log:
  Fix and test case for Bug 10645 - Problem with simple types restricted to xsd:date and xsd:dateTime
  from "Sapozhnikov, Michael" <msapozhnikov@axsone.com>
  
  Revision  Changes    Path
  1.44      +12 -1     xml-axis/java/test/wsdl/types/ComprehensiveTypes.wsdl
  
  Index: ComprehensiveTypes.wsdl
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/test/wsdl/types/ComprehensiveTypes.wsdl,v
  retrieving revision 1.43
  retrieving revision 1.44
  diff -u -r1.43 -r1.44
  --- ComprehensiveTypes.wsdl	15 Sep 2002 19:16:17 -0000	1.43
  +++ ComprehensiveTypes.wsdl	23 Sep 2002 19:24:39 -0000	1.44
  @@ -16,12 +16,21 @@
     <types>
       <xsd:schema 
           targetNamespace="urn:comprehensive-types.types.wsdl.test"
  -        xmlns:xsd="http://www.w3.org/1999/XMLSchema">
  +        xmlns:xsd="http://www.w3.org/1999/XMLSchema"
  +        xmlns:xsd2="http://www.w3.org/2001/XMLSchema">
   
         <xsd:simpleType name="simple">
           <xsd:restriction base="xsd:string" />
         </xsd:simpleType>
         
  +      <xsd:simpleType name="simpleDate">
  +        <xsd:restriction base="xsd:date" />
  +      </xsd:simpleType>
  +
  +      <xsd:simpleType name="simpleDateTime">
  +        <xsd:restriction base="xsd2:dateTime" />
  +      </xsd:simpleType>
  +      
         <xsd:simpleType name="enum">
           <xsd:restriction base="xsd:string">
             <xsd:enumeration value="one"/>                      
  @@ -91,6 +100,8 @@
           <xsd:complexType>
             <xsd:all>
               <xsd:element name="one" type="typens:simple"/> <!-- Ref to a simple
type -->
  +            <xsd:element name="dateone" type="typens:simpleDate"/>
  +            <xsd:element name="datetwo" type="typens:simpleDateTime"/>
               <xsd:element name="two" type="typens2:fwd"/> <!-- Forward type use
to dif namespace -->
               <xsd:element ref="typens2:three"/>           <!-- Forward ref use
to a dif namespace -->
               <xsd:element ref="typens:enumValue" maxOccurs="unbounded" /> <!--
ref & maxOccurs -->
  
  
  
  1.31      +19 -0     xml-axis/java/src/org/apache/axis/wsdl/toJava/JavaBeanWriter.java
  
  Index: JavaBeanWriter.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/wsdl/toJava/JavaBeanWriter.java,v
  retrieving revision 1.30
  retrieving revision 1.31
  diff -u -r1.30 -r1.31
  --- JavaBeanWriter.java	18 Sep 2002 16:10:36 -0000	1.30
  +++ JavaBeanWriter.java	23 Sep 2002 19:24:40 -0000	1.31
  @@ -429,7 +429,26 @@
                       pw.println("        catch (org.apache.axis.types.URI.MalformedURIException
mue) {");
                       pw.println("            this.value = new org.apache.axis.types.URI();");
                       pw.println("       }");
  +                } 
  +                else if (simpleValueType.equals("java.util.Date")) {
  +                  pw.println("        try {");
  +                  pw.println("            this.value = (java.text.DateFormat.getDateTimeInstance()).parse(value);");
  +                  pw.println("        }");
  +                  pw.println("        catch (java.text.ParseException e){");
  +                  pw.println("            throw new java.lang.RuntimeException(e.toString());");
  +                  pw.println("        }");
                   }
  +                else if (simpleValueType.equals("java.util.Calendar")) {
  +                  pw.println("        java.util.Calendar cal = java.util.Calendar.getInstance();");

  +                  pw.println("        try {");
  +                  pw.println("          java.util.Date dt = (java.text.DateFormat.getDateTimeInstance()).parse(value);");
  +                  pw.println("          cal.setTime(dt);");
  +                  pw.println("          this.value = cal;");
  +                  pw.println("        }");
  +                  pw.println("        catch (java.text.ParseException e){");
  +                  pw.println("            throw new java.lang.RuntimeException(e.toString());");
  +                  pw.println("        }");
  +                }                
                   else {
                       pw.println("        this.value = new " +
                                  simpleValueType + "(value);");
  
  
  

Mime
View raw message