You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-user@ws.apache.org by Dino De Luca <di...@hotmail.com> on 2001/04/02 15:51:21 UTC

Array Serialization: thanks for the help...

I believe that is incredible that nobody in this mailing list has never used 
a soap vector.......




>From: "Dino De Luca" <di...@hotmail.com>
>Reply-To: soap-user@xml.apache.org
>To: soap-user@xml.apache.org
>Subject: Re: Array Serialization
>Date: Mon, 02 Apr 2001 14:29:31 +0200
>
>...Stéphane Bélanger has written that:
>
>>I never had to map an array, it is supported directly in Apache SOAP.
>>
>>Stéphane
>
>Is array a standard or an user-defined datatypes?
>
>thaks
>  dino
>
>
>>From: Rainer Faller <ra...@innovations.de>
>>Reply-To: soap-user@xml.apache.org
>>To: soap-user@xml.apache.org
>>Subject: Re: Array Serialization
>>Date: Mon, 02 Apr 2001 13:20:55 +0200
>>
>> > Terry_Truta@i2.com schrieb:
>> >
>> > Has anyone done array serialization? None of the examples do this. What
>>do
>> > you put for the javaType parameter for the mapTypes method of the
>> > SOAPMappingRegistry object? Better yet does any have some sample code?
>> > Thanks.
>>
>>If you want to use the standard datatypes like String or int, nothing
>>has to be done. No changes to the mapping, no own
>>serializer/deserializer. For user-defined datatypes follow the
>>instructions of Stéphane Bélanger posted in this thread.
>>Rainer
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
>>For additional commands, email: soap-user-help@xml.apache.org
>>
>
>_________________________________________________________________________
>Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
>For additional commands, email: soap-user-help@xml.apache.org
>

_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
For additional commands, email: soap-user-help@xml.apache.org


Re: Array Serialization: WSDL-toolkit?

Posted by Christian Spanner <sd...@sdm.de>.
Hi all,

Olivier Brand schrieb:
> 
> If you would like to include an array in your XSD schema 
> (to be included in a WSDL file for instance),
> you need to write something like:
> 
> <xsd:complexType name="ArrayOfInt">
>     <xsd:complexContent>
>         <xsd:restriction base="soapenc:Array">
>             <attribute ref="soapenc:arrayType" wsdl:arrayType="xsd:int[]" />
>         </xsd:restriction>
>     </xsd:complexContent>
> </xsd:complexType>
> 
> The syntax is not obvious, but should work 
> (if you add to the IBM WSTK toolkit of course).

so, does the IBM web service toolkit support this?
I tried in vain to generate classes for arrays like

<xsd:complexType name="MovieList">
  <xsd:element name="item"
    type="tns:Movie"
    minOccurs="0"    
    maxOccurs="unbounded"/>
</xsd:complexType>

All I get is 
public class MovieList{
  public Movie item_Elem;
  ...
}

there must be a way to use something as simple as arrays
with the IBM Web Services Toolkit, no?

thanks &
greetings,
    Christian

-- 
Christian Spanner		mailto:spanner@sdm.de
sd&m AG          		http://www.sdm.de
software design & management
Thomas-Dehler-Str. 27, 81737 Muenchen, Germany
Tel +49 89 63812-457, Fax -515

---------------------------------------------------------------------
To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
For additional commands, email: soap-user-help@xml.apache.org


Re: Array Serialization: thanks for the help...

Posted by Olivier Brand <ol...@intraware.com>.
James,

I know. It is quite strange that Arrays have been introduced in SOAP while XSD
can do about the same.
In SOAP, you can define a multi-dimensional array, or even sparse arrays,
something difficult in XSD.

But... I agree with you, I think that arrays don't make sense when you have
something like XSD.
Arrays are easier to manipulate than Schemas though...

Olivier

James Yegerlehner wrote:

> Olivier or anyone:
>
> Can you say why this:
>
> > If you would like to include an array in your XSD schema (to be included
> > in a WSDL file for instance),
> > you need to write something like:
> > <xsd:complexType name="ArrayOfInt">
> >    <xsd:complexContent>
> >        <xsd:restriction base="soapenc:Array">
> >            <attribute ref="soapenc:arrayType" wsdl:arrayType="xsd:int[]"
> />
> >        </xsd:restriction>
> >    </xsd:complexContent>
> > </xsd:complexType>
>
> would be preferable to something like this, which looks simpler to me:
>
> <xsd:complexType name="ArrayOfInt">
>     <xsd:sequence>
>         <xsd:element name="item" type="xsd:integer" minOccurs="0"
> maxOccurs="unbounded"/>
>     </xsd:sequence>
> </xsd:complexType>
>
> I'm confused about SOAP having some special way of specifying arrays, when
> schema already fully comprehend the concept of cardinality via  minOccurs
> and maxOccurs.
>
> Thanks in advance for any insights.
>
> Regards,
> James Yegerlehner
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
> For additional commands, email: soap-user-help@xml.apache.org

Re: Array Serialization: thanks for the help...

Posted by Olivier Brand <ol...@intraware.com>.
James,

I know. It is quite strange that Arrays have been introduced in SOAP while XSD
can do about the same.
In SOAP, you can define a multi-dimensional array, or even sparse arrays,
something difficult in XSD.

But... I agree with you, I think that arrays don't make sense when you have
something like XSD.
Arrays are easier to manipulate than Schemas though...

Olivier

James Yegerlehner wrote:

> Olivier or anyone:
>
> Can you say why this:
>
> > If you would like to include an array in your XSD schema (to be included
> > in a WSDL file for instance),
> > you need to write something like:
> > <xsd:complexType name="ArrayOfInt">
> >    <xsd:complexContent>
> >        <xsd:restriction base="soapenc:Array">
> >            <attribute ref="soapenc:arrayType" wsdl:arrayType="xsd:int[]"
> />
> >        </xsd:restriction>
> >    </xsd:complexContent>
> > </xsd:complexType>
>
> would be preferable to something like this, which looks simpler to me:
>
> <xsd:complexType name="ArrayOfInt">
>     <xsd:sequence>
>         <xsd:element name="item" type="xsd:integer" minOccurs="0"
> maxOccurs="unbounded"/>
>     </xsd:sequence>
> </xsd:complexType>
>
> I'm confused about SOAP having some special way of specifying arrays, when
> schema already fully comprehend the concept of cardinality via  minOccurs
> and maxOccurs.
>
> Thanks in advance for any insights.
>
> Regards,
> James Yegerlehner
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
> For additional commands, email: soap-user-help@xml.apache.org

Re: Array Serialization: thanks for the help...

Posted by James Yegerlehner <ja...@kamiak.com>.
Olivier or anyone:

Can you say why this:

> If you would like to include an array in your XSD schema (to be included
> in a WSDL file for instance),
> you need to write something like:
> <xsd:complexType name="ArrayOfInt">
>    <xsd:complexContent>
>        <xsd:restriction base="soapenc:Array">
>            <attribute ref="soapenc:arrayType" wsdl:arrayType="xsd:int[]"
/>
>        </xsd:restriction>
>    </xsd:complexContent>
> </xsd:complexType>

would be preferable to something like this, which looks simpler to me:

<xsd:complexType name="ArrayOfInt">
    <xsd:sequence>
        <xsd:element name="item" type="xsd:integer" minOccurs="0"
maxOccurs="unbounded"/>
    </xsd:sequence>
</xsd:complexType>

I'm confused about SOAP having some special way of specifying arrays, when
schema already fully comprehend the concept of cardinality via  minOccurs
and maxOccurs.

Thanks in advance for any insights.

Regards,
James Yegerlehner



---------------------------------------------------------------------
To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
For additional commands, email: soap-user-help@xml.apache.org


Re: Array Serialization: WSDL-toolkit?

Posted by Christian Spanner <sd...@sdm.de>.
Hi all,

Olivier Brand schrieb:
> 
> If you would like to include an array in your XSD schema 
> (to be included in a WSDL file for instance),
> you need to write something like:
> 
> <xsd:complexType name="ArrayOfInt">
>     <xsd:complexContent>
>         <xsd:restriction base="soapenc:Array">
>             <attribute ref="soapenc:arrayType" wsdl:arrayType="xsd:int[]" />
>         </xsd:restriction>
>     </xsd:complexContent>
> </xsd:complexType>
> 
> The syntax is not obvious, but should work 
> (if you add to the IBM WSTK toolkit of course).

so, does the IBM web service toolkit support this?
I tried in vain to generate classes for arrays like

<xsd:complexType name="MovieList">
  <xsd:element name="item"
    type="tns:Movie"
    minOccurs="0"    
    maxOccurs="unbounded"/>
</xsd:complexType>

All I get is 
public class MovieList{
  public Movie item_Elem;
  ...
}

there must be a way to use something as simple as arrays
with the IBM Web Services Toolkit, no?

thanks &
greetings,
    Christian

-- 
Christian Spanner		mailto:spanner@sdm.de
sd&m AG          		http://www.sdm.de
software design & management
Thomas-Dehler-Str. 27, 81737 Muenchen, Germany
Tel +49 89 63812-457, Fax -515

---------------------------------------------------------------------
To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
For additional commands, email: soap-user-help@xml.apache.org


Re: Array Serialization: thanks for the help...

Posted by James Yegerlehner <ja...@kamiak.com>.
Olivier or anyone:

Can you say why this:

> If you would like to include an array in your XSD schema (to be included
> in a WSDL file for instance),
> you need to write something like:
> <xsd:complexType name="ArrayOfInt">
>    <xsd:complexContent>
>        <xsd:restriction base="soapenc:Array">
>            <attribute ref="soapenc:arrayType" wsdl:arrayType="xsd:int[]"
/>
>        </xsd:restriction>
>    </xsd:complexContent>
> </xsd:complexType>

would be preferable to something like this, which looks simpler to me:

<xsd:complexType name="ArrayOfInt">
    <xsd:sequence>
        <xsd:element name="item" type="xsd:integer" minOccurs="0"
maxOccurs="unbounded"/>
    </xsd:sequence>
</xsd:complexType>

I'm confused about SOAP having some special way of specifying arrays, when
schema already fully comprehend the concept of cardinality via  minOccurs
and maxOccurs.

Thanks in advance for any insights.

Regards,
James Yegerlehner



---------------------------------------------------------------------
To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
For additional commands, email: soap-user-help@xml.apache.org


Re: Array Serialization: thanks for the help...

Posted by Olivier Brand <ol...@intraware.com>.
Dino,

The array is not an XSD type (see www.w3c.org). SOAP defines a new type in the
soapenc namespace:

Array

The Array Serializer in Apache SOAP follows the w3c specification (see
www.w3c.org):

<SOAP-ENC:Array SOAP-ENC:arrayType="xsd:int[2]">
    <item>3</item>
    <item>4</item>
</SOAP-ENC:Array>

Note that each element in the array is named : "item". This is not required. You
will see other example with the type. Usually, you can (and should) "guess" the
type reading the arrayType attribute.

SOAP Apache allows to have any type in the array since it is calling the
marshaller of the passed object.

If you would like to include an array in your XSD schema (to be included in a
WSDL file for instance),
you need to write something like:

<xsd:complexType name="ArrayOfInt">
    <xsd:complexContent>
        <xsd:restriction base="soapenc:Array">
            <attribute ref="soapenc:arrayType" wsdl:arrayType="xsd:int[]" />
        </xsd:restriction>
    </xsd:complexContent>
</xsd:complexType>

The syntax is not obvious, but should work (if you add to the IBM WSTK toolkit
of course).

Hope that it confuses you more than before.... ;-)

Olivier

Dino De Luca wrote:

> I believe that is incredible that nobody in this mailing list has never used
> a soap vector.......
>
> >From: "Dino De Luca" <di...@hotmail.com>
> >Reply-To: soap-user@xml.apache.org
> >To: soap-user@xml.apache.org
> >Subject: Re: Array Serialization
> >Date: Mon, 02 Apr 2001 14:29:31 +0200
> >
> >...Stéphane Bélanger has written that:
> >
> >>I never had to map an array, it is supported directly in Apache SOAP.
> >>
> >>Stéphane
> >
> >Is array a standard or an user-defined datatypes?
> >
> >thaks
> >  dino
> >
> >
> >>From: Rainer Faller <ra...@innovations.de>
> >>Reply-To: soap-user@xml.apache.org
> >>To: soap-user@xml.apache.org
> >>Subject: Re: Array Serialization
> >>Date: Mon, 02 Apr 2001 13:20:55 +0200
> >>
> >> > Terry_Truta@i2.com schrieb:
> >> >
> >> > Has anyone done array serialization? None of the examples do this. What
> >>do
> >> > you put for the javaType parameter for the mapTypes method of the
> >> > SOAPMappingRegistry object? Better yet does any have some sample code?
> >> > Thanks.
> >>
> >>If you want to use the standard datatypes like String or int, nothing
> >>has to be done. No changes to the mapping, no own
> >>serializer/deserializer. For user-defined datatypes follow the
> >>instructions of Stéphane Bélanger posted in this thread.
> >>Rainer
> >>
> >>---------------------------------------------------------------------
> >>To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
> >>For additional commands, email: soap-user-help@xml.apache.org
> >>
> >
> >_________________________________________________________________________
> >Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
> >
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
> >For additional commands, email: soap-user-help@xml.apache.org
> >
>
> _________________________________________________________________________
> Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
> For additional commands, email: soap-user-help@xml.apache.org

Re: Array Serialization: thanks for the help...

Posted by Olivier Brand <ol...@intraware.com>.
Dino,

The array is not an XSD type (see www.w3c.org). SOAP defines a new type in the
soapenc namespace:

Array

The Array Serializer in Apache SOAP follows the w3c specification (see
www.w3c.org):

<SOAP-ENC:Array SOAP-ENC:arrayType="xsd:int[2]">
    <item>3</item>
    <item>4</item>
</SOAP-ENC:Array>

Note that each element in the array is named : "item". This is not required. You
will see other example with the type. Usually, you can (and should) "guess" the
type reading the arrayType attribute.

SOAP Apache allows to have any type in the array since it is calling the
marshaller of the passed object.

If you would like to include an array in your XSD schema (to be included in a
WSDL file for instance),
you need to write something like:

<xsd:complexType name="ArrayOfInt">
    <xsd:complexContent>
        <xsd:restriction base="soapenc:Array">
            <attribute ref="soapenc:arrayType" wsdl:arrayType="xsd:int[]" />
        </xsd:restriction>
    </xsd:complexContent>
</xsd:complexType>

The syntax is not obvious, but should work (if you add to the IBM WSTK toolkit
of course).

Hope that it confuses you more than before.... ;-)

Olivier

Dino De Luca wrote:

> I believe that is incredible that nobody in this mailing list has never used
> a soap vector.......
>
> >From: "Dino De Luca" <di...@hotmail.com>
> >Reply-To: soap-user@xml.apache.org
> >To: soap-user@xml.apache.org
> >Subject: Re: Array Serialization
> >Date: Mon, 02 Apr 2001 14:29:31 +0200
> >
> >...Stéphane Bélanger has written that:
> >
> >>I never had to map an array, it is supported directly in Apache SOAP.
> >>
> >>Stéphane
> >
> >Is array a standard or an user-defined datatypes?
> >
> >thaks
> >  dino
> >
> >
> >>From: Rainer Faller <ra...@innovations.de>
> >>Reply-To: soap-user@xml.apache.org
> >>To: soap-user@xml.apache.org
> >>Subject: Re: Array Serialization
> >>Date: Mon, 02 Apr 2001 13:20:55 +0200
> >>
> >> > Terry_Truta@i2.com schrieb:
> >> >
> >> > Has anyone done array serialization? None of the examples do this. What
> >>do
> >> > you put for the javaType parameter for the mapTypes method of the
> >> > SOAPMappingRegistry object? Better yet does any have some sample code?
> >> > Thanks.
> >>
> >>If you want to use the standard datatypes like String or int, nothing
> >>has to be done. No changes to the mapping, no own
> >>serializer/deserializer. For user-defined datatypes follow the
> >>instructions of Stéphane Bélanger posted in this thread.
> >>Rainer
> >>
> >>---------------------------------------------------------------------
> >>To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
> >>For additional commands, email: soap-user-help@xml.apache.org
> >>
> >
> >_________________________________________________________________________
> >Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
> >
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
> >For additional commands, email: soap-user-help@xml.apache.org
> >
>
> _________________________________________________________________________
> Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
> For additional commands, email: soap-user-help@xml.apache.org