axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tom Jordahl <t...@macromedia.com>
Subject RE: anyType support fixed
Date Fri, 27 Sep 2002 14:21:04 GMT

I fixed a bug yesterday (13007) that 'fixes' this for elements in Beans.

I tried to write a test case for it, but failed because (as I pointed out in my check in and
bugzilla comments) we wont match an operation that is defined to be anyType in WSDD but has
a signature type of anything but java.lang.Object (because this is the only type mapping registered
for anyType).

I believe Bob's bug was because (as he said) he is using this inside a Bean and just by registering
a custom serializer it works. But the generated WSDL was wrong, so I fixed it to work the
same a parameters.

I wonder if the same would work for operation parameters?

--
Tom Jordahl
Macromedia Server Development



-----Original Message-----
From: Glen Daniels [mailto:gdaniels@macromedia.com]
Sent: Thursday, September 26, 2002 6:10 PM
To: 'axis-dev@xml.apache.org'
Subject: RE: anyType support fixed



WHOA!

Why do we WANT anyType appearing anywhere for this?  IMO, we don't.

If you have myop(Object obj), THAT should generate anyType, because we have a mapping for
Object<->anyType in the registry.  Then at runtime, we're free to do something like:
 
   if (obj instanceof SomeClassIHaveAMappingFor)...

Just saying that any class we don't have a mapping for generates anyTypes if it appears in
signatures will cause all kinds of headaches.  They should fail if there is no explicit mapping
for the class in question, since as you say there's no way we could expect to serialize/deserialize
them!!

If I'm understanding what you're proposing here, I'm -1 to it.  (am I missing something?)

--Glen

> -----Original Message-----
> From: Tom Jordahl [mailto:tomj@macromedia.com]
> Sent: Thursday, September 26, 2002 5:59 PM
> To: 'axis-dev@xml.apache.org'
> Subject: RE: anyType support fixed
> 
> 
> 
> Thanks Rich!
> Verified that anyType comes out in the right places for this service:
> 
> public class MyService {  
>     public String myop(MyStruct in, java.util.Locale locin) {
>         return "out";
>     }
> }
> public class MyStruct {
>     public java.util.Locale loc;
>     public String name;
> }
> 
> 
> I don't know how to make a test for this, which isn't so 
> important since this service will never work.
> 
> Anyone have any thoughts on how we might get a service like this work?
> --
> Tom Jordahl
> Macromedia Server Development
> 
> 
> 
> -----Original Message-----
> From: scheu@apache.org [mailto:scheu@apache.org]
> Sent: Thursday, September 26, 2002 5:52 PM
> To: xml-axis-cvs@apache.org
> Subject: cvs commit: xml-axis/java/src/org/apache/axis/wsdl/fromJava
> Emitter.java Types.java
> 
> 
> scheu       2002/09/26 14:52:13
> 
>   Modified:    java/src/org/apache/axis/wsdl/fromJava Emitter.java
>                         Types.java
>   Log:
>   More changes per review of code by Tom and I.  this is all related
>   to the 12347 bug fix.
>   
>   Revision  Changes    Path
>   1.65      +1 -1      
> xml-axis/java/src/org/apache/axis/wsdl/fromJava/Emitter.java
>   
>   Index: Emitter.java
>   ===================================================================
>   RCS file: 
> /home/cvs/xml-axis/java/src/org/apache/axis/wsdl/fromJava/Emit
> ter.java,v
>   retrieving revision 1.64
>   retrieving revision 1.65
>   diff -u -r1.64 -r1.65
>   --- Emitter.java	26 Sep 2002 21:13:25 -0000	1.64
>   +++ Emitter.java	26 Sep 2002 21:52:12 -0000	1.65
>   @@ -1088,7 +1088,7 @@
>                QName typeQName = 
>                    types.writeTypeForPart(javaType,
>                                           param.getTypeQName());
>   -            types.writeElementForPart(javaType,
>   +            QName elemQName = types.writeElementForPart(javaType,
>                                          param.getTypeQName());
>                if (typeQName != null) {
>                    part.setName(param.getName());
>   
>   
>   
>   1.63      +13 -7     
> xml-axis/java/src/org/apache/axis/wsdl/fromJava/Types.java
>   
>   Index: Types.java
>   ===================================================================
>   RCS file: 
> /home/cvs/xml-axis/java/src/org/apache/axis/wsdl/fromJava/Types.java,v
>   retrieving revision 1.62
>   retrieving revision 1.63
>   diff -u -r1.62 -r1.63
>   --- Types.java	26 Sep 2002 21:13:25 -0000	1.62
>   +++ Types.java	26 Sep 2002 21:52:13 -0000	1.63
>   @@ -231,7 +231,9 @@
>         * @param type <code>Class</code> to generate the XML 
> Schema info for
>         * @param qname <code>QName</code> of the type.  If 
> null, qname is
>         *             defaulted from the class.
>   -     * @return the QName of the generated Schema type, null if void
>   +     * @return the QName of the generated Schema type, 
> null if void,
>   +     *         if the Class type cannot be converted to a 
> schema type
>   +     *         then xsd:anytype is returned.
>         */
>        public QName writeTypeForPart(Class type, QName qname) 
> throws AxisFault {
>            //patch by costin to fix an NPE; commented out 
> till we find out what the problem is
>   @@ -265,8 +267,10 @@
>                writeWsdlTypesElement();
>            }
>    
>   -        // write the type
>   -        writeType(type, qname);
>   +        // Write the type, if problems occur use ANYTYPE
>   +        if (writeType(type, qname) == null) {
>   +            qname = Constants.XSD_ANYTYPE;
>   +        }
>            return qname;
>        }
>    
>   @@ -318,8 +322,10 @@
>                writeWsdlTypesElement();
>            }
>    
>   -        // Write Element
>   -        writeTypeAsElement(type, qname);
>   +        // Write Element, if problems occur return null.
>   +        if (writeTypeAsElement(type, qname) == null) {
>   +            qname = null;
>   +        }
>            return qname;
>        }
>    
>   @@ -380,7 +386,7 @@
>        /**
>         * Create a schema element for the given type
>         * @param type the class type
>   -     * @return the QName of the generated Element or null 
> if no element written
>   +     * @return the QName of the generated Element or problems occur
>         */
>        private QName writeTypeAsElement(Class type, QName 
> qName) throws AxisFault {
>            if (qName == null ||
>   @@ -598,7 +604,7 @@
>         *
>         * @param type Class for which to generate schema
>         * @param qName of the type to write
>   -     * @return a prefixed string for the schema type
>   +     * @return a prefixed string for the schema type or 
> null if problems occur
>         */
>        public String writeType(Class type, QName qName) 
> throws AxisFault {
>            // Get a corresponding QName if one is not provided
>   
>   
>   
> 

Mime
View raw message