You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by James Yegerlehner <ja...@kamiak.com> on 2001/12/07 07:01:27 UTC
Re: Wsdl2java and collections
> As Russell indicated, this support is not required by JAX-RPC.
Several other frameworks support it so if interoperability is desirable then
I'd think it behooves Axis to support it too. FWIW here's a graphic from a
whitepaper we are working up:
http://www.kamiak.com/images/platformIndependentTypes.jpg
It shows you what some other frameworks are doing. At the moment the
Axis-generated code is the only one of the three that doesn't handle the
collection :(.
> If we were to implement this feature...
>
> 1) What would be the java representation of the characterReferences field
> and methods?
How about:
private Vector characterReferences; // and the associated read
accessor
Perhaps this for any cardinality other than minOccurs=1, maxOccurs=1.
>
> 2) Should the runtime enforce the minOccurs/maxOccurs attributes?
I don't think it's necessary to do everything before one can do anything.
I'd suggest starting simple. Unless someone has a lot of extra time.
>
> 3) Should the generated class have a way to enforce the
minOccurs/maxOccurs
> attributes?
See #2. The user could always write his own code to enforce such
constraints. Much better than lacking support for collections altogether.
>
> 4) Supporting this feature could be much more difficult in an <all> group?
> Should the feature be limited to a <sequence> group?
Beggars can't be choosers; <sequence> and not <all> is better than neither
<sequence> nor <all> <g>.
>
> 5) Some subsets of minOccurs/maxOccurs would be easier to implement.
> a) minOccurs=0 maxOccurs=1
> b) minOccurs=0 maxOccurs= unbounded .....requires no checking
As above, something simple that just creates a Vector to handle
anything other than ( minOccurs=1, maxOccurs = 1 ) would be OK IMO.
Thanks very much.
Regards,
James Yegerlehner
Kamiak Corp.
james@kamiak.com
>
> Thanks,
>
> Rich Scheuerle
> XML & Web Services Development
> 512-838-5115 (IBM TL 678-5115)
>
>
>
> "Mark Young"
> <mark@kamiak.c To: <ax...@xml.apache.org>
> om> cc:
> Subject: Wsdl2java and
collections
> 11/28/2001
> 01:27 PM
> Please respond
> to axis-dev
>
>
>
>
>
> I don't believe that Wsdl2java correctly handles a collection within a
> complex type:
>
> For example, use this complex type in your message part:
>
>
>
> <xsd:complexType name="LoanApplication">
> <xsd:sequence>
> <xsd:element name="name" type="xsd:string"/>
> <xsd:element name="address" type="xsd:string"/>
> <xsd:element name="networth" type="xsd:double"/>
> <!--Must have at least two character references
>
> -->
> <xsd:element name="characterReferences" type="xsd:string" maxOccurs
> ="unbounded" minOccurs="2">
> </xsd:element>
> </xsd:sequence>
> </xsd:complexType>
>
>
> When I do so, I see that the resulting java class looks like this:
>
>
> public class LoanApplication implements java.io.Serializable {
> private java.lang.String name;
> private java.lang.String address;
> private double networth;
> private java.lang.String characterReferences;
>
> ...
>
> public java.lang.String getCharacterReferences() {
> return characterReferences;
> }
>
> public void setCharacterReferences(java.lang.String
> characterReferences) {
> this.characterReferences = characterReferences;
> }
> }
>
>
>
>
>
> LoanApplication.characterReferences is not a collection.
>
> Are there any plans to address this?
>
>
> Regards,
>
> Mark Young
> mark@kamiak.com
>
>