axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tom Jordahl (JIRA)" <axis-...@ws.apache.org>
Subject [jira] Commented: (AXIS-1615) java2wsdl generates wrong return format
Date Sun, 21 Nov 2004 15:55:26 GMT
     [ http://nagoya.apache.org/jira/browse/AXIS-1615?page=comments#action_55715 ]
     
Tom Jordahl commented on AXIS-1615:
-----------------------------------

Axis is broken for wrapped/doc/lit arrays.

The WSDL we put out for this service:
  String[] echoStringArray(String [] argArray) {
    return argArray; 
  }

Is this:
   <element name="echoArray">
    <complexType>
     <sequence>
      <element maxOccurs="unbounded" name="argArray" type="xsd:string"/>
     </sequence>
    </complexType>
   </element>

And sure enough, we send XML that matches this:
<echoArray>
  <argArray>one</argArray>
  <argArray>one</argArray>
  <argArray>one</argArray>
</echoArray>

Which Axis can't deserialize because there is no wrapping element for it to hang the array
deserializer off of.


I can fix it to match .NET, which I think is much better by changing code in Types.java, line
601 to comment out the array condition:

        //if (javaType.isArray() && !javaType.equals(byte[].class)) {
        //    type = writeTypeForPart(javaType.getComponentType(), null);
        //} else {
            type = writeTypeForPart(javaType, type);
        //}

Then we get WSDL like this:

<element name="echoArray">
 <complexType>
  <sequence>
   <element maxOccurs="unbounded" name="argArray" type="impl:ArrayOf_xsd_string"/>
  </sequence>
 </complexType>
</element>
<complexType name="ArrayOf_xsd_string">
 <sequence>
  <element maxOccurs="unbounded" minOccurs="0" name="item" type="xsd:string"/>
 </sequence>
</complexType>

But WSDL2Java is completely screwing the pooch on this as it creates a type called ArrayOfString.java
and the stub returns an array of these. (!!)

So I believe I need to go at it from the WSDL2Java point of view now, going with the 'fixed'
wrapped WSDL.  This also fixes the document style WSDL as well, as now it is generating this:
   <element name="argArray" type="xsd:string"/>

I know we weren't this broken generating stubs with .NET arrays in 1.1, so things have really
regressed in this area.

I am working on this now.

> java2wsdl generates wrong return format
> ---------------------------------------
>
>          Key: AXIS-1615
>          URL: http://nagoya.apache.org/jira/browse/AXIS-1615
>      Project: Axis
>         Type: Bug
>   Components: WSDL processing
>     Versions: 1.2 Beta, 1.2RC1
>  Environment: Windows XP all current updates, Tomcat 5.0, Java v1.4.2_05-b04
>     Reporter: Paul Bouche
>  Attachments: TestSimpleArraysService.java, doc.wsdl, wrapped.wsdl
>
> When returning an array of int or arrays of String, ie. int[] or String[] and creating
a wsdl for this service using
> java2wsdl -y DOCUMENT -u LITERAL -lhttp://foo testsimplearrays.TestSimpleArraysService
-o doc.wsdl a wrong return type is generated. Instead of int[] it is int, the same with String[].
> Please see attached files for reproduction.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://nagoya.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


Mime
View raw message