axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rku...@apache.org
Subject cvs commit: xml-axis/java/src/org/apache/axis/wsdlgen Namespaces.java Types.java
Date Wed, 05 Dec 2001 19:45:41 GMT
rkumar      01/12/05 11:45:41

  Modified:    java/src/org/apache/axis/wsdlgen Namespaces.java Types.java
  Log:
  Fix a bug with namespace create and lookup which was causing custom mapping to be ignored
for the types section
  
  Revision  Changes    Path
  1.4       +12 -3     xml-axis/java/src/org/apache/axis/wsdlgen/Namespaces.java
  
  Index: Namespaces.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/wsdlgen/Namespaces.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- Namespaces.java	2001/11/30 00:40:41	1.3
  +++ Namespaces.java	2001/12/05 19:45:41	1.4
  @@ -65,7 +65,7 @@
    * @author rkumar@borland.com
    */
   public class Namespaces extends HashMap {
  -    private static int prefixCount = 1;
  +    private int prefixCount = 1;
       private HashMap namespacePrefixMap = null;
   
       public Namespaces() {
  @@ -82,7 +82,7 @@
       public String getCreate(String key) {
           Object value = super.get(key);
           if (value == null) {
  -            value = makeNamespace((String) key);
  +            value = makeNamespaceFromPackageName((String) key);
               put(key, value, null);
           }
           return (String) value;
  @@ -98,7 +98,7 @@
       public String getCreate(String key, String prefix) {
           Object value = super.get(key);
           if (value == null) {
  -            value = makeNamespace((String) key);
  +            value = makeNamespaceFromPackageName((String) key);
               put(key, value, prefix);
           }
           return (String) value;
  @@ -195,6 +195,15 @@
           if (clsName.lastIndexOf('.') == -1)
               return protocol + "://" + "DefaultNamespace";
           String packageName = clsName.substring(0, clsName.lastIndexOf('.'));
  +        return makeNamespaceFromPackageName(packageName, protocol);       
  +    }
  +
  +    private static String makeNamespaceFromPackageName(String packageName) {
  +      return makeNamespaceFromPackageName(packageName, "http");       
  +    }
  +    
  +    
  +    private static String makeNamespaceFromPackageName(String packageName, String protocol)
{
           StringTokenizer st = new StringTokenizer( packageName, "." );
           String[] words = new String[ st.countTokens() ];
           for(int i = 0; i < words.length; ++i)
  
  
  
  1.7       +1 -1      xml-axis/java/src/org/apache/axis/wsdlgen/Types.java
  
  Index: Types.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/wsdlgen/Types.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- Types.java	2001/11/30 17:51:17	1.6
  +++ Types.java	2001/12/05 19:45:41	1.7
  @@ -204,7 +204,7 @@
               // Get the QName from the registry, or create our own.
               qName = reg.getTypeQName(type);
               if (qName == null) {
  -                String ns = namespaces.getCreate(type.getName());
  +                String ns = namespaces.getCreate(type.getName().substring(0, type.getName().lastIndexOf('.')));
                   String pre = namespaces.getCreatePrefix(ns);
                   String localPart = type.getName().substring(type.getName().lastIndexOf('.')
+ 1);
                   localPart = localPart.replace('$', '_');
  
  
  

Mime
View raw message