You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Wilfred Springer <wi...@sun.com> on 2003/01/30 18:02:31 UTC

[Fwd: [Fwd: Need a work-around for missing xsd:list support]]

-- 
________________________________________________________________
Wilfred Springer               Phone  : +31 (0)3 3451 5736
Java Architect                 Mobile : +31 (0)6 2295 7321
Sun Java Center                Fax    : +31 (0)3 3451 5734
Sun Microsystems Netherlands   Mail   : wilfred.springer@sun.com

Re: [Fwd: [Fwd: Need a work-around for missing xsd:list support]]

Posted by Wilfred Springer <wi...@sun.com>.
It doesn't work this way:

      <xsd:simpleType name="AgreementType">
	<xsd:restriction base="xsd:string">
	  <xsd:enumeration value="Grip"/>
	  <xsd:enumeration value="BusinessSelect"/>
	  <xsd:enumeration value="FlexibelCompany"/>
	</xsd:restriction>
      </xsd:simpleType>
      <xsd:complexType name="AgreementTypeArray">
	<xsd:complexContent>
	  <xsd:restriction base="soapenc:Array">
	    <attribute ref="soapenc:arrayType"
	      wsdl:arrayType="tns:AgreementType"/>
	  </xsd:restriction>
	</xsd:complexContent>
      </xsd:complexType>

      <xsd:simpleType name="AgreementType">
	<xsd:annotation>
	  <xsd:documentation>Defines the possible valid values for
AgreementType</xsd:documentation>
	</xsd:annotation>
	<xsd:restriction base="xsd:string">
	  <xsd:enumeration value="Grip"/>
	  <xsd:enumeration value="BusinessSelect"/>
	  <xsd:enumeration value="FlexibelCompany"/>
	</xsd:restriction>
      </xsd:simpleType>
      <xsd:complexType name="AgreementTypeArray">
	<xsd:complexContent>
	  <xsd:restriction base="soapenc:Array">
	    <attribute ref="soapenc:arrayType"
	      wsdl:arrayType="tns:AgreementType"/>
	  </xsd:restriction>
	</xsd:complexContent>
      </xsd:complexType>

in this case AgreementTypeArray is turned into a class without any
accessors. So it seems useless. (I think this is supposed to work. Maybe
it is a bug?)

This however *does* work. I tried it before, but without cleaning my
build directory, so it seemed I still got the AgreementTypeArray.
Thanks.

      <xsd:simpleType name="AgreementType">
	<xsd:restriction base="xsd:string">
	  <xsd:enumeration value="Grip"/>
	  <xsd:enumeration value="BusinessSelect"/>
	  <xsd:enumeration value="FlexibelCompany"/>
	</xsd:restriction>
      </xsd:simpleType>
      <xsd:complexType name="AgreementTypeArray">
	<xsd:complexContent>
	  <xsd:restriction base="soapenc:Array">
	    <xsd:sequence>
	      <xsd:element name="agreementTypes"
		type="tns:AgreementType"
		maxOccurs="unbounded"/>
	    </xsd:sequence>
	  </xsd:restriction>
	</xsd:complexContent>
      </xsd:complexType>


On Thu, 2003-01-30 at 18:05, Benjamin Tomasini wrote:
> Why not just use a typed array?  Collection interfaces generally loose
> their meaning over an RPC call as they are dependant on implementations
> that are hidden from the interface.
> 
> Ben
> 
> On Thu, 2003-01-30 at 12:02, Wilfred Springer wrote:
> > 
> > -- 
> > ________________________________________________________________
> > Wilfred Springer               Phone  : +31 (0)3 3451 5736
> > Java Architect                 Mobile : +31 (0)6 2295 7321
> > Sun Java Center                Fax    : +31 (0)3 3451 5734
> > Sun Microsystems Netherlands   Mail   : wilfred.springer@sun.com
> > ----
> > 
> 
> > From: Wilfred Springer <wi...@agilejava.com>
> > To: wilfred.springer@sun.com
> > Subject: [Fwd: Need a work-around for missing xsd:list support]
> > Date: 30 Jan 2003 17:50:21 +0000
> > 
> > 
> > -- 
> > Wilfred Springer <wi...@agilejava.com>
> > ----
> > 
> 
> > From: Wilfred Springer <wi...@agilejava.com>
> > To: axis-user@xml.apache.org
> > Subject: Need a work-around for missing xsd:list support
> > Date: 30 Jan 2003 16:42:44 +0000
> > 
> > Hi all,
> > 
> > <xsd:simpleType name="FooBarType">
> > <xsd:restriction base="xsd:string">
> > <xsd:enumeration value="foo"/>
> > <xsd:enumeration value="bar"/>
> > </xsd:restriction>
> > </xsl:simpleType>
> > 
> > <xsd:simpleType name="FooBarTypeList">
> > <xsd:list itemType="FooBarType"/>
> > </xsd:simpleType>
> > 
> > I browsed through the mailing list and noticed that some people already
> > discovered that this doesn't work. So I need a workaround. The problem
> > is, no matter how hard I try, I can't come up with a proper solution.
> > 
> > I tried several things, like:
> > 
> > <xsd:complexType name="FooBarTypeList">
> > <xsd:element
> >     maxOccurs="unbounded"
> >     name="fooBarType"
> >     type="FooBarType"/>
> > </xsd:complexType>
> > 
> > And several other options found in the JAXRPC spec, like specifying
> > soap:Array as a restriction etc.
> > 
> > Nothing works. The wsdl2java ant task will never generate something
> > useful. (Most of the time, it will generate a class called
> > FooBarTypeList containing no accessors at all.)
> > 
> > Please! Help me out!
> > 
> > -- 
> > Wilfred Springer <wi...@agilejava.com>
> 
> 
-- 
________________________________________________________________
Wilfred Springer               Phone  : +31 (0)3 3451 5736
Java Architect                 Mobile : +31 (0)6 2295 7321
Sun Java Center                Fax    : +31 (0)3 3451 5734
Sun Microsystems Netherlands   Mail   : wilfred.springer@sun.com


Re: [Fwd: [Fwd: Need a work-around for missing xsd:list support]]

Posted by Benjamin Tomasini <bt...@neteverything.com>.
Why not just use a typed array?  Collection interfaces generally loose
their meaning over an RPC call as they are dependant on implementations
that are hidden from the interface.

Ben

On Thu, 2003-01-30 at 12:02, Wilfred Springer wrote:
> 
> -- 
> ________________________________________________________________
> Wilfred Springer               Phone  : +31 (0)3 3451 5736
> Java Architect                 Mobile : +31 (0)6 2295 7321
> Sun Java Center                Fax    : +31 (0)3 3451 5734
> Sun Microsystems Netherlands   Mail   : wilfred.springer@sun.com
> ----
> 

> From: Wilfred Springer <wi...@agilejava.com>
> To: wilfred.springer@sun.com
> Subject: [Fwd: Need a work-around for missing xsd:list support]
> Date: 30 Jan 2003 17:50:21 +0000
> 
> 
> -- 
> Wilfred Springer <wi...@agilejava.com>
> ----
> 

> From: Wilfred Springer <wi...@agilejava.com>
> To: axis-user@xml.apache.org
> Subject: Need a work-around for missing xsd:list support
> Date: 30 Jan 2003 16:42:44 +0000
> 
> Hi all,
> 
> <xsd:simpleType name="FooBarType">
> <xsd:restriction base="xsd:string">
> <xsd:enumeration value="foo"/>
> <xsd:enumeration value="bar"/>
> </xsd:restriction>
> </xsl:simpleType>
> 
> <xsd:simpleType name="FooBarTypeList">
> <xsd:list itemType="FooBarType"/>
> </xsd:simpleType>
> 
> I browsed through the mailing list and noticed that some people already
> discovered that this doesn't work. So I need a workaround. The problem
> is, no matter how hard I try, I can't come up with a proper solution.
> 
> I tried several things, like:
> 
> <xsd:complexType name="FooBarTypeList">
> <xsd:element
>     maxOccurs="unbounded"
>     name="fooBarType"
>     type="FooBarType"/>
> </xsd:complexType>
> 
> And several other options found in the JAXRPC spec, like specifying
> soap:Array as a restriction etc.
> 
> Nothing works. The wsdl2java ant task will never generate something
> useful. (Most of the time, it will generate a class called
> FooBarTypeList containing no accessors at all.)
> 
> Please! Help me out!
> 
> -- 
> Wilfred Springer <wi...@agilejava.com>