Return-Path: Delivered-To: apmail-xml-axis-dev-archive@xml.apache.org Received: (qmail 72014 invoked by uid 500); 8 Feb 2002 23:18:55 -0000 Mailing-List: contact axis-dev-help@xml.apache.org; run by ezmlm Precedence: bulk Reply-To: axis-dev@xml.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list axis-dev@xml.apache.org Received: (qmail 72005 invoked by uid 500); 8 Feb 2002 23:18:55 -0000 Delivered-To: apmail-xml-axis-cvs@apache.org Date: 8 Feb 2002 23:18:54 -0000 Message-ID: <20020208231854.26293.qmail@icarus.apache.org> From: scheu@apache.org To: xml-axis-cvs@apache.org Subject: cvs commit: xml-axis/java/test/encoding TestDeser2001.java X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N scheu 02/02/08 15:18:54 Modified: java/samples/echo TestClient.java java/src/org/apache/axis/encoding DefaultTypeMappingImpl.java Hex.java java/src/org/apache/axis/encoding/ser HexDeserializer.java HexDeserializerFactory.java HexSerializer.java HexSerializerFactory.java java/src/org/apache/axis/wsdl/toJava Emitter.java JavaWriterFactory.java NoopWriter.java SymbolTable.java Type.java Utils.java WriterFactory.java java/test/encoding TestDeser2001.java Added: java/src/org/apache/axis/wsdl/toJava BaseType.java BaseTypeMapping.java Removed: java/src/org/apache/axis/wsdl/toJava BaseJavaType.java Log: Following improvments are made: - Changed WSDL2Java to use the TypeMapping information. - Changed BaseJavaType to BaseType - Enhanced Hex Serializer/Deserializer to support byte[] - Minor changes to test cases. Revision Changes Path 1.50 +13 -2 xml-axis/java/samples/echo/TestClient.java Index: TestClient.java =================================================================== RCS file: /home/cvs/xml-axis/java/samples/echo/TestClient.java,v retrieving revision 1.49 retrieving revision 1.50 diff -u -r1.49 -r1.50 --- TestClient.java 8 Feb 2002 22:14:10 -0000 1.49 +++ TestClient.java 8 Feb 2002 23:18:53 -0000 1.50 @@ -64,6 +64,7 @@ import org.apache.axis.encoding.ser.ArrayDeserializerFactory; import org.apache.axis.encoding.TypeMappingRegistry; import org.apache.axis.encoding.TypeMapping; +import org.apache.axis.encoding.Hex; import org.apache.axis.Constants; import org.apache.axis.utils.JavaUtils; import org.apache.axis.utils.Options; @@ -103,6 +104,16 @@ protected boolean equals(Object obj1, Object obj2) { if (obj1 == null || obj2 == null) return (obj1 == obj2); if (obj1.equals(obj2)) return true; + + // For comparison purposes, get the array of bytes representing + // the Hex object. + if (obj1 instanceof Hex) { + obj1 = ((Hex) obj1).getBytes(); + } + if (obj2 instanceof Hex) { + obj2 = ((Hex) obj2).getBytes(); + } + if (obj1 instanceof Date && obj2 instanceof Date) if (Math.abs(((Date)obj1).getTime()-((Date)obj2).getTime())<1000) return true; @@ -121,7 +132,7 @@ } return true; } - + if (obj1 instanceof List) obj1 = JavaUtils.convert(obj1, Object[].class); if (obj2 instanceof List) @@ -247,7 +258,7 @@ new SOAPStruct(3, "three", 3.3F)}); test("Void ", null); test("Base64 ", "Base64".getBytes()); - test("HexBinary ", new org.apache.axis.encoding.Hex("3344")); + test("HexBinary ", new Hex("3344")); test("Date ", new Date()); test("Decimal ", new BigDecimal("3.14159")); test("Boolean ", Boolean.TRUE); 1.8 +25 -7 xml-axis/java/src/org/apache/axis/encoding/DefaultTypeMappingImpl.java Index: DefaultTypeMappingImpl.java =================================================================== RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/encoding/DefaultTypeMappingImpl.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- DefaultTypeMappingImpl.java 1 Feb 2002 22:08:25 -0000 1.7 +++ DefaultTypeMappingImpl.java 8 Feb 2002 23:18:53 -0000 1.8 @@ -131,6 +131,9 @@ // ser factory for the last one registered will be chosen. Likewise // if two javaTypes for XSD_DATE are registered, the deserializer // factory for the last one registered will be chosen. + // Corollary: Please be very careful with the order. The + // runtime, Java2WSDL and WSDL2Java emitters all + // use this code to get type mapping information. // 2) Even if the SOAP 1.1 format is used over the wire, an // attempt is made to receive SOAP 1.2 format from the wire. // This is the reason why the soap encoded primitives are @@ -161,6 +164,18 @@ myRegister(Constants.SOAP_BYTE, java.lang.Byte.class, null, null, false, true); + // Hex binary data needs to use the hex binary serializer/deserializer + myRegister(Constants.XSD_HEXBIN, Hex.class, + new HexSerializerFactory( + Hex.class, Constants.XSD_HEXBIN), + new HexDeserializerFactory( + Hex.class, Constants.XSD_HEXBIN),true); + myRegister(Constants.XSD_HEXBIN, byte[].class, + new HexSerializerFactory( + byte[].class, Constants.XSD_HEXBIN), + new HexDeserializerFactory( + byte[].class, Constants.XSD_HEXBIN),true); + // SOAP 1.1 // byte[] -ser-> XSD_BASE64 // Byte[] -ser-> array of Byte @@ -183,8 +198,6 @@ // If SOAP 1.1 over the wire, map wrapper classes to XSD primitives. - // Even though the java class is an object, since these are all - // xsd primitives, treat them as a primitive. myRegister(Constants.XSD_STRING, java.lang.String.class, null, null, true); myRegister(Constants.XSD_BOOLEAN, java.lang.Boolean.class, @@ -222,6 +235,8 @@ myRegister(Constants.XSD_BYTE, byte.class, null, null,true); + + // Map QNAME to the jax rpc QName class myRegister(Constants.XSD_QNAME, javax.xml.rpc.namespace.QName.class, new BeanSerializerFactory(javax.xml.rpc.namespace.QName.class, @@ -229,6 +244,8 @@ new BeanDeserializerFactory(javax.xml.rpc.namespace.QName.class, Constants.XSD_QNAME), true); + + // The closest match for anytype is Object myRegister(Constants.XSD_ANYTYPE, java.lang.Object.class, null, null, false); @@ -254,9 +271,6 @@ new DateDeserializerFactory(java.util.Date.class, Constants.XSD_DATE), true); - myRegister(Constants.XSD_HEXBIN, Hex.class, - new HexSerializerFactory(), - new HexDeserializerFactory(),true); // Use the Map Serialization for Hashtables, Map and HashMap // The SOAP_MAP will be deserialized into a HashMap @@ -290,17 +304,21 @@ false); // All array objects automatically get associated with the SOAP_ARRAY. - //There is no way to do this with a hash table, + // There is no way to do this with a hash table, // so it is done directly in getTypeQName. // Internally the runtime uses ArrayList objects to hold arrays... // which is the reason that ArrayList is associated with SOAP_ARRAY. // In addition, handle all objects that implement the List interface - //as a SOAP_ARRAY + // as a SOAP_ARRAY myRegister(Constants.SOAP_ARRAY, java.util.List.class, new ArraySerializerFactory(), new ArrayDeserializerFactory(), false); myRegister(Constants.SOAP_ARRAY, java.util.ArrayList.class, + new ArraySerializerFactory(), + new ArrayDeserializerFactory(), + false); + myRegister(Constants.SOAP_ARRAY, Object[].class, new ArraySerializerFactory(), new ArrayDeserializerFactory(), false); 1.7 +4 -0 xml-axis/java/src/org/apache/axis/encoding/Hex.java Index: Hex.java =================================================================== RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/encoding/Hex.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- Hex.java 6 Nov 2001 21:52:28 -0000 1.6 +++ Hex.java 8 Feb 2002 23:18:53 -0000 1.7 @@ -74,6 +74,10 @@ m_value = decode(string); } + public Hex(byte[] bytes){ + m_value = bytes; + } + public byte[] getBytes(){ return m_value; } 1.2 +23 -1 xml-axis/java/src/org/apache/axis/encoding/ser/HexDeserializer.java Index: HexDeserializer.java =================================================================== RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/encoding/ser/HexDeserializer.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- HexDeserializer.java 26 Jan 2002 02:40:34 -0000 1.1 +++ HexDeserializer.java 8 Feb 2002 23:18:53 -0000 1.2 @@ -78,13 +78,28 @@ * @see XML Schema 3.2.16 */ public class HexDeserializer extends DeserializerImpl implements Deserializer { + + public QName xmlType; + public Class javaType; + + StringBuffer buf = null; + + public HexDeserializer(Class javaType, QName xmlType) { + this.xmlType = xmlType; + this.javaType = javaType; + } /** * Handle any characters found in the data */ public void characters(char [] chars, int start, int end) throws SAXException { - value = new Hex(new String(chars, start, end)); + // Characters are collected in a buffer because + // SAX may chunk the data. + if (buf == null) { + buf = new StringBuffer(); + } + buf.append(chars, start, end); } /** @@ -94,6 +109,13 @@ DeserializationContext context) throws SAXException { + if (buf != null) { + if (javaType == byte[].class) { + value = Hex.decode(buf.toString()); + } else { + value = new Hex(buf.toString()); + } + } super.onEndElement(namespace,localName, context); if (value == null) value = new Hex(""); } 1.2 +2 -2 xml-axis/java/src/org/apache/axis/encoding/ser/HexDeserializerFactory.java Index: HexDeserializerFactory.java =================================================================== RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/encoding/ser/HexDeserializerFactory.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- HexDeserializerFactory.java 26 Jan 2002 02:40:34 -0000 1.1 +++ HexDeserializerFactory.java 8 Feb 2002 23:18:53 -0000 1.2 @@ -74,7 +74,7 @@ * @author Rich Scheuerle */ public class HexDeserializerFactory extends BaseDeserializerFactory { - public HexDeserializerFactory() { - super(HexDeserializer.class, false); // Can't share deserializers + public HexDeserializerFactory(Class javaType, QName xmlType) { + super(HexDeserializer.class, false, xmlType, javaType); // Can't share deserializers } } 1.3 +14 -3 xml-axis/java/src/org/apache/axis/encoding/ser/HexSerializer.java Index: HexSerializer.java =================================================================== RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/encoding/ser/HexSerializer.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- HexSerializer.java 2 Feb 2002 18:06:18 -0000 1.2 +++ HexSerializer.java 8 Feb 2002 23:18:53 -0000 1.3 @@ -73,6 +73,7 @@ import org.apache.axis.encoding.Hex; import org.w3c.dom.Element; import org.w3c.dom.Document; +import org.apache.axis.encoding.Base64; /** * Serializer for hexBinary. * @@ -82,6 +83,13 @@ */ public class HexSerializer implements Serializer { + public QName xmlType; + public Class javaType; + public HexSerializer(Class javaType, QName xmlType) { + this.xmlType = xmlType; + this.javaType = javaType; + } + /** * Serialize a Hex quantity. */ @@ -89,10 +97,13 @@ Object value, SerializationContext context) throws IOException { - Hex data = (Hex) value; - context.startElement(name, attributes); - context.writeString(data.toString()); + if (javaType == Hex.class) { + context.writeString(((Hex) value).toString()); + } else { + context.writeString(Hex.encode((byte[]) value)); + } + context.endElement(); } 1.2 +2 -2 xml-axis/java/src/org/apache/axis/encoding/ser/HexSerializerFactory.java Index: HexSerializerFactory.java =================================================================== RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/encoding/ser/HexSerializerFactory.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- HexSerializerFactory.java 26 Jan 2002 02:40:34 -0000 1.1 +++ HexSerializerFactory.java 8 Feb 2002 23:18:53 -0000 1.2 @@ -74,7 +74,7 @@ * @author Rich Scheuerle */ public class HexSerializerFactory extends BaseSerializerFactory { - public HexSerializerFactory() { - super(HexSerializer.class, true); // Share HexSerializer instance + public HexSerializerFactory(Class javaType, QName xmlType) { + super(HexSerializer.class, true, xmlType, javaType); // Share HexSerializer instance } } 1.17 +33 -1 xml-axis/java/src/org/apache/axis/wsdl/toJava/Emitter.java Index: Emitter.java =================================================================== RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/wsdl/toJava/Emitter.java,v retrieving revision 1.16 retrieving revision 1.17 diff -u -r1.16 -r1.17 --- Emitter.java 6 Feb 2002 21:24:29 -0000 1.16 +++ Emitter.java 8 Feb 2002 23:18:53 -0000 1.17 @@ -84,6 +84,10 @@ import java.util.Map; import java.util.ResourceBundle; import java.util.Vector; +import javax.wsdl.QName; + +import org.apache.axis.encoding.TypeMapping; +import org.apache.axis.encoding.DefaultSOAP12TypeMappingImpl; /** * This class produces java files for stubs, skeletons, and types from a @@ -162,7 +166,10 @@ } } - symbolTable = new SymbolTable(namespaces, bGenerateImports, bDebug); + symbolTable = new SymbolTable(namespaces, + writerFactory.getBaseTypeMapping(), + bGenerateImports, + bDebug); symbolTable.add(context, def, doc); writerFactory.writerPass(def, symbolTable); if (bDebug) { @@ -593,5 +600,30 @@ } public void setEmitter(Emitter emitter) {} + + /** + * Get TypeMapping to use for translating + * QNames to java base types + */ + BaseTypeMapping btm = null; + public BaseTypeMapping getBaseTypeMapping() { + if (btm == null) { + btm = new BaseTypeMapping() { + TypeMapping defaultTM = DefaultSOAP12TypeMappingImpl.create(); + public String getBaseName(QName qNameIn) { + javax.xml.rpc.namespace.QName qName = + new javax.xml.rpc.namespace.QName( + qNameIn.getNamespaceURI(), + qNameIn.getLocalPart()); + Class cls = defaultTM.getClassForQName(qName); + if (cls == null) + return null; + else + return JavaUtils.getTextClassName(cls.getName()); + } + }; + } + return btm; + } } } 1.13 +27 -0 xml-axis/java/src/org/apache/axis/wsdl/toJava/JavaWriterFactory.java Index: JavaWriterFactory.java =================================================================== RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/wsdl/toJava/JavaWriterFactory.java,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- JavaWriterFactory.java 7 Feb 2002 14:15:06 -0000 1.12 +++ JavaWriterFactory.java 8 Feb 2002 23:18:53 -0000 1.13 @@ -70,6 +70,8 @@ import javax.wsdl.Service; import org.apache.axis.utils.JavaUtils; +import org.apache.axis.encoding.TypeMapping; +import org.apache.axis.encoding.DefaultSOAP12TypeMappingImpl; /** * This is Wsdl2java's implementation of the WriterFactory. @@ -513,5 +515,30 @@ } } } // determineIfHoldersNeeded + + /** + * Get TypeMapping to use for translating + * QNames to java base types + */ + BaseTypeMapping btm = null; + public BaseTypeMapping getBaseTypeMapping() { + if (btm == null) { + btm = new BaseTypeMapping() { + TypeMapping defaultTM = DefaultSOAP12TypeMappingImpl.create(); + public String getBaseName(QName qNameIn) { + javax.xml.rpc.namespace.QName qName = + new javax.xml.rpc.namespace.QName( + qNameIn.getNamespaceURI(), + qNameIn.getLocalPart()); + Class cls = defaultTM.getClassForQName(qName); + if (cls == null) + return null; + else + return JavaUtils.getTextClassName(cls.getName()); + } + }; + } + return btm; + } } // class JavaWriterFactory 1.2 +1 -0 xml-axis/java/src/org/apache/axis/wsdl/toJava/NoopWriter.java Index: NoopWriter.java =================================================================== RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/wsdl/toJava/NoopWriter.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- NoopWriter.java 11 Dec 2001 15:08:47 -0000 1.1 +++ NoopWriter.java 8 Feb 2002 23:18:54 -0000 1.2 @@ -68,4 +68,5 @@ */ public void write() throws IOException { } // write + } // class NoopWriter 1.28 +19 -15 xml-axis/java/src/org/apache/axis/wsdl/toJava/SymbolTable.java Index: SymbolTable.java =================================================================== RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/wsdl/toJava/SymbolTable.java,v retrieving revision 1.27 retrieving revision 1.28 diff -u -r1.27 -r1.28 --- SymbolTable.java 7 Feb 2002 15:36:27 -0000 1.27 +++ SymbolTable.java 8 Feb 2002 23:18:54 -0000 1.28 @@ -136,11 +136,15 @@ private boolean debug = false; + private BaseTypeMapping btm = null; /** * Construct a symbol table with the given Namespaces. */ - public SymbolTable(Namespaces namespaces, boolean addImports, boolean debug) { + public SymbolTable(Namespaces namespaces, + BaseTypeMapping btm, + boolean addImports, boolean debug) { this.namespaces = namespaces; + this.btm = btm; this.addImports = addImports; this.debug = debug; } // ctor @@ -605,9 +609,9 @@ TypeEntry refType = getTypeEntry(refQName, false); if (refType == null) { // Not defined yet, add one - String baseJavaName = Utils.getBaseJavaName(refQName); - if (baseJavaName != null) - refType = new BaseJavaType(refQName); + String baseName = btm.getBaseName(refQName); + if (baseName != null) + refType = new BaseType(refQName); else refType = new UndefinedType(refQName); symbolTablePut(refType); @@ -633,9 +637,9 @@ else { // Create a TypeEntry representing this type/element - String baseJavaName = Utils.getBaseJavaName(qName); - if (baseJavaName != null) { - symbolTablePut(new BaseJavaType(qName)); + String baseName = btm.getBaseName(qName); + if (baseName != null) { + symbolTablePut(new BaseType(qName)); } else if (!isElement) { symbolTablePut(new DefinedType(qName, node)); @@ -674,9 +678,9 @@ TypeEntry collEl = getTypeEntry(typeAttr, false); if (collEl == null) { // Collection Element Type not defined yet, add one. - String baseJavaName = Utils.getBaseJavaName(typeAttr); - if (baseJavaName != null) { - collEl = new BaseJavaType(typeAttr); + String baseName = btm.getBaseName(typeAttr); + if (baseName != null) { + collEl = new BaseType(typeAttr); } else { collEl = new UndefinedType(typeAttr); } @@ -684,10 +688,10 @@ } symbolTablePut(new CollectionType(qName, collEl, node, "[]")); } else { - // Add a BaseJavaType or Undefined Type/Element - String baseJavaName = Utils.getBaseJavaName(qName); - if (baseJavaName != null) - symbolTablePut(new BaseJavaType(qName)); + // Add a BaseType or Undefined Type/Element + String baseName = btm.getBaseName(qName); + if (baseName != null) + symbolTablePut(new BaseType(qName)); else if (forElement.value == false) symbolTablePut(new UndefinedType(qName)); else @@ -716,7 +720,7 @@ } // The QName may represent a base java name, so check this first - String fullJavaName = Utils.getBaseJavaName(qName); + String fullJavaName = btm.getBaseName(qName); if (fullJavaName != null) return fullJavaName; 1.4 +2 -2 xml-axis/java/src/org/apache/axis/wsdl/toJava/Type.java Index: Type.java =================================================================== RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/wsdl/toJava/Type.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- Type.java 14 Dec 2001 20:01:16 -0000 1.3 +++ Type.java 8 Feb 2002 23:18:54 -0000 1.4 @@ -67,7 +67,7 @@ public abstract class Type extends TypeEntry { /** - * Create a Type object for an xml construct name that represents a base java type + * Create a Type object for an xml construct name that represents a base type */ protected Type(QName pqName) { super(pqName); @@ -82,7 +82,7 @@ } /** - * Create a Type object for an xml construct that is not a base java type + * Create a Type object for an xml construct that is not a base type */ protected Type(QName pqName, Node pNode) { super(pqName, pNode); 1.13 +2 -0 xml-axis/java/src/org/apache/axis/wsdl/toJava/Utils.java Index: Utils.java =================================================================== RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/wsdl/toJava/Utils.java,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- Utils.java 1 Feb 2002 04:38:18 -0000 1.12 +++ Utils.java 8 Feb 2002 23:18:54 -0000 1.13 @@ -106,6 +106,7 @@ * ---------------------------------------------------------- * @param QName */ + /* public static String getBaseJavaName(QName qName) { String localName = qName.getLocalPart(); if (Constants.isSchemaXSD(qName.getNamespaceURI())) { @@ -177,6 +178,7 @@ } return null; } + */ /** * getNillableQName returns the QName to use if the nillable=true 1.3 +6 -0 xml-axis/java/src/org/apache/axis/wsdl/toJava/WriterFactory.java Index: WriterFactory.java =================================================================== RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/wsdl/toJava/WriterFactory.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- WriterFactory.java 13 Dec 2001 17:33:17 -0000 1.2 +++ WriterFactory.java 8 Feb 2002 23:18:54 -0000 1.3 @@ -116,4 +116,10 @@ * Provide the Emitter to the factory. */ public void setEmitter(Emitter emitter); + + /** + * Get TypeMapping to use for translating + * QNames to java base types + */ + public BaseTypeMapping getBaseTypeMapping(); } 1.1 xml-axis/java/src/org/apache/axis/wsdl/toJava/BaseType.java Index: BaseType.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 * . */ package org.apache.axis.wsdl.toJava; import org.w3c.dom.Node; import javax.wsdl.QName; /** * This Type is for a QName represents a Base Type (i.e. xsd:string represents a java.lang.String) */ public class BaseType extends Type { public BaseType(QName pqName) { super(pqName); } }; 1.1 xml-axis/java/src/org/apache/axis/wsdl/toJava/BaseTypeMapping.java Index: BaseTypeMapping.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 * . */ package org.apache.axis.wsdl.toJava; import org.w3c.dom.Node; import javax.wsdl.QName; /** * Get the base language name for a qname */ public abstract class BaseTypeMapping { /** * If the qname is registered in the target language, * return the name of the registered type. * @param QName representing a type * @return name of the registered type or null if not registered. */ public abstract String getBaseName(QName qName); }; 1.8 +2 -2 xml-axis/java/test/encoding/TestDeser2001.java Index: TestDeser2001.java =================================================================== RCS file: /home/cvs/xml-axis/java/test/encoding/TestDeser2001.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- TestDeser2001.java 18 Nov 2001 19:21:39 -0000 1.7 +++ TestDeser2001.java 8 Feb 2002 23:18:54 -0000 1.8 @@ -65,12 +65,12 @@ public void testHex() throws Exception { deserialize("50A9", - new Hex("50A9")); + new Hex("50A9"),true); } public void testHexNull() throws Exception { deserialize("", - new Hex("")); + new Hex(""),true); } public void testMapWithNils() throws Exception {