Hi Jean,

Here is how I handled my arrays in document-literal. In the SOAP message I
wanted a Contact object which would have an array of objects of type
Address. WSDL generated for such a bean wasn't working for doc-literal type.
I mean wsdl looked ok but the client didn't work and some other problems
also.

So I created an object called ArrayOfAddresses which has an array of objects
of type address.

And now my Contact Object has the ArrayOfAddresses object and I get the
actual array of address object by doing ArrayOfAddresses.getArray().

This way the wsdl generated was fine and the client worked fine too.

Thanks
Vikas

-----Original Message-----
From: Jean-Francois Denise - Sun Microsystems
[mailto:[EMAIL PROTECTED] 
Sent: Wednesday, July 21, 2004 1:24 AM
To: [EMAIL PROTECTED]
Cc: '[EMAIL PROTECTED]'
Subject: Re: Arrays in Document Style WebServices

Hello,
I am porting to WRAPPED/LITERAL and I observed the same thing.
Looking at the code, I noticed that if the param/return type is 
class.isArray, the componentType only is set as the ParameterDesc type.
Is it what literal is about? If I understand well, it means that the 
Array doesn't exits in literal.

Vikas Phonsa wrote:

> Hi Everybody,
>
>  
>
> I'm trying to convert my rpc based web service to document style using 
> axis 1.1 and am having some issues with the wsdl generated by 
> java2wsdl. I need to get a Contact in my SOAP message which could have 
> an array of addresses. When I use rpc I get following in my wsdl ( 
> which shows that complexType Contact has an array of addresses):
>
>  
>
>  <complexType name="Contact">
>
>     <sequence>
>
>      <element name="arrayOfContactAddress" nillable="true" 
> type="impl:ArrayOfContactAddress"/>
>
>     </sequence>
>
> </complexType>
>
>      
>
> <complexType name="ContactAddress">
>
>     <sequence>
>
>      <element name="personalCity" nillable="true" type="xsd:string"/>
>
>      <element name="personalAddressName" nillable="true" 
> type="xsd:string"/>
>
>      <element name="personalCountry" nillable="true" type="xsd:string"/>
>
>      <element name="personalStreetAddress" nillable="true" 
> type="xsd:string"/>
>
>   </sequence>
>
>    </complexType>
>
>    <complexType name="ArraryOfContactAddress">
>
>     <complexContent>
>
>      <restriction base="soapenc:Array">
>
>       <attribute ref="soapenc:arrayType" 
> wsdl:arrayType="impl:ContactAddress[]"/>
>
>      </restriction>
>
>     </complexContent>
>
>    </complexType>
>
>  
>
>  
>
> But when I use "document-literal" style, things get weird in the wsdl 
> generated from the very same java bean and I get this:
>
>  
>
>  
>
> <complexType name="Contact">
>
>     <sequence>    
>
>      <element maxOccurs="unbounded" name="arrayOfContactAddress" 
> nillable="true" type="impl:ContactAddress"/>
>
> </sequence>
>
> <complexType>
>
> <complexType name="ContactAddress">
>
>     <sequence>
>
>      <element name="personalCity" nillable="true" type="xsd:string"/>
>
>      <element name="personalAddressName" nillable="true" 
> type="xsd:string"/>
>
>      <element name="personalCountry" nillable="true" type="xsd:string"/>
>
>      <element name="personalStreetAddress" nillable="true" 
> type="xsd:string"/>
>
>  
>
>     </sequence>
>
> <complexType>
>
>  
>
> In this case the child element "arrayOfContactAddress"  of Contact is 
> no more of type array and so in the SOAP
>
> Message element named arrayOfContactAddress is repeated over and over 
> again, instead of an array which has elements of type
>
> ContactAddress
>
>  
>
> And I need an array of address in a Contact.
>
>  
>
> How could this be taken care of in my document style web service.
>
>  
>
> And I may not be able to upgrade to axis 1.2
>
>  
>
> Thanks in advance.
>
>  
>
> Vikas
>
>  
>
>  
>
>  
>


-- 
----------------------------------------------------------------------
Jean-Francois Denise            Sun Microsystems
Sun ONE/Java Web Services
email: [EMAIL PROTECTED] 
Internal home page : http://icncweb.france/~jfdenise
-------------------------------------------------------------------

Reply via email to