1 Reply Latest reply on Dec 13, 2006 6:40 PM by Jason Greene

    JBWS-1260 and WSDL to Java Array Mappings

    Darran Lofthouse Master

      I am currently working on JBWS-1260, I have a set of 27 different WSDLs that I have put through wscompile and I am then putting through wstools to compare the generated artifacts.

      Whenever wscompile encounters an element with a maxOccurs greater than '0' e.g.

       <complexType name='TelephoneNumber'>
       <sequence>
       <element name='number' nillable='true' type='string' maxOccurs='unbounded'/>
       </sequence>
       </complexType>
      


      The generated jaxrpc mapping has it mapped as: -

       <java-xml-type-mapping>
       <java-type>java.lang.String[]</java-type>
       <anonymous-type-qname>http://test.jboss.org/ws/jbws1260/types:TelephoneNumber>number[1,unbounded]</anonymous-type-qname>
       <qname-scope>complexType</qname-scope>
       </java-xml-type-mapping>
      


      This apears to be because of the following from the Web Services for J2EE 1.1 specification: -


      3. If element E has a maxOccurs attribute greater than 1, then it also has a 'hidden' anonymous type called A. A is an array of the enclosed type. The qname-scope of A is complexType and the name of A is...
      a. If E has a name attribute, then the name of A is "E[<minOccursValue>,<maxOccursValue>]" where E is the value of E?s name attribute. The name is entered as an anonymous-type-qname.
      b. If E has no name attribute, then the name of A is "R[<minOccursValue>,<maxOccursValue>]" where R is the name of the referent element. The name is entered as an anonymous-type-qname.


      And the examples in the specification apear to confirm this.

      Is there any reason why we do no generate these mappings at all? Or should this be added?