Title: Message
Hi Igor!
 
If there is a clean and logical way to do "deployment free" typemappings, with the understanding that they may well still break if two communicating parties have different versions of the same class, then I think it's a super cool feature that we should implement, yes.
 
It won't affect interop with any other toolkit whether we choose a single "java:" namespace or individual ones for each package.  Anyone reading a schema type needs to map the [namespace,localname] pair to a type.  .NET isn't going to "natively" have any concept of which type/package the "http://my.app.corp.etc" namespace maps to any more than it will understand the "java:" namespace.
 
While it is true in many cases that schema namespaces serve the same function as java packages, they really serve to disambiguate potentially clashing names.  In other words, a given [ns,local] pair will map uniquely to a certain type even if three different companies choose to make a type with a localName of "address".  What we're trying to acheive with "deployment-free" type mapping is to allow Java based toolkits to easily notice, based on the type QName, that a schema type maps to a particular Java class.  It's almost "six of one, half dozen of another" how we do this in terms of whether the namespace indicates an "automatic" java type and the localname the full class name, or whether the namespace indicates both the "javaness" and the package.  I'm OK with either, but I don't like the "http://" mapping in the second case, as it's not unique enough, IMHO.  If you want to have a namespace URI like "java://my.package.name" (namespaces are URIs, but never get parsed as such, so the java: prefix doesn't need to actually be registered as a protocol), I could see that being OK, but I think it's simpler just having "http://xml.apache.org/soap/java" be the namespace (or whatever interoperable java: namespace mapping we settle on with GLUE + WASP).
 
--Glen
-----Original Message-----
From: Sedukhin, Igor [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 22, 2002 10:32 AM
To: [EMAIL PROTECTED]
Subject: RE: Default type mapping (another attempt)

Glen, so then if we change it to <foo xsi:type="java:org.apache.axis.mypackage.MyClass">, then do you agree it's good to have the "deployment-free" typemapping in Axis?
 
I'm not sure it's going to interop well with .NET... With the current http://my.app.corp.etc mapping it interops just fine...
 
Also I thought XML Schema suggests that XML namespaces resemble packages in OO model, aren't they?
Axis may become too Java centric in its introp if we ignore this, IMO.

-- Igor Sedukhin .. ([EMAIL PROTECTED])
-- (631) 342-4325 .. 1 CA Plaza, Islandia, NY 11788

-----Original Message-----
From: Glen Daniels [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 22, 2002 10:00 AM
To: '[EMAIL PROTECTED]'
Subject: RE: Default type mapping (another attempt)

-1
 
I don't think this is the right solution to this.
 
IMO, we shouldn't map java types to individual namespaces per package, but if we want a "deployment-free" typemapping (i.e. one where the QName of the type gives us enough info to figure out the java type), we should go with a syntax like:
 
<foo xsi:type="java:org.apache.axis.mypackage.MyClass">....
 
This seems way cleaner to me, and will interoperate, if we do it right, with GLUE and WASP and other java toolkits which use this pattern.
 
--Glen
-----Original Message-----
From: Sedukhin, Igor [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 22, 2002 9:37 AM
To: '[EMAIL PROTECTED]'
Subject: Default type mapping (another attempt)

I'm trying it again.

The WSDL2Java and Java2WSDL take care of properly mapping http://my.app.corp.etc namespaces back to and from etc.corp.app.my packages (see code fragments below). SOAP processing pipeline does not. It always assumes the typemappings must have been provided by the service deployer. I'd like to make an attempt to sligtly modify DefaultTypeMappingsImpl to take care of this by default.

I know we had discussion before, but it has faded out and there was no coherent +1 or -1 on this. So let me try to start my +1.

Here is the code in WSDL2Java and java2WSDL that I was referring to
=== in axis.wsdl.fromJava.Types.getTypeQName(Class type) ===
                String pkg = getPackageNameFromFullName(type.getName());
                String lcl = getLocalNameFromFullName(type.getName());

                String ns = namespaces.getCreate(pkg);
                String pre = namespaces.getCreatePrefix(ns);
                String localPart = lcl.replace('$', '_');
                qName = new javax.xml.rpc.namespace.QName(ns, localPart);

=== in axis.wsdl.toJava.Utils.makePackageName(String namespace) ===
        //convert illegal java identifier
        hostname = hostname.replace('-', '_');

        // tokenize the hostname and reverse it
        StringTokenizer st = new StringTokenizer( hostname, "." );
        String[] words = new String[ st.countTokens() ];
        for(int i = 0; i < words.length; ++i)
            words[i] = st.nextToken();

        StringBuffer sb = new StringBuffer(80);
        for(int i = words.length-1; i >= 0; --i) {
            String word = words[i];
            if (JavaUtils.isJavaKeyword(word)) {
                word = JavaUtils.makeNonJavaKeyword(word);
            }
            // seperate with dot
            if( i != words.length-1 )
                sb.append('.');

            // convert digits to underscores
            if( Character.isDigit(word.charAt(0)) )
                sb.append('_');
            sb.append( word );
        }
        return sb.toString();

-- Igor Sedukhin .. ([EMAIL PROTECTED])
-- (631) 342-4325 .. 1 CA Plaza, Islandia, NY 11788


Reply via email to