Simon,

Your schema is correct.  WSDL2Java will correctly interpret the type as an
Option[].

However, when the Axis runtime serializes the Option[], it does not know
the name
of the array component element (in your case "option").    The axis runtime
always uses
the name "item" when serializing the component element names...and this has
been generally
accepted by non-axis services.  (Note that there are other array encoding
styles that do not have a
way to indicate the name of the array elements.  Thus I believe that most
services accept
any name.)

Is the use of "item" instead of "option" causing a problem or are you just
asking a question ?

Thanks,

Rich Scheuerle
XML & Web Services Development
512-838-5115  (IBM TL 678-5115)


                                                                                       
                                        
                      "Simon McClenahan"                                               
                                        
                      <simon.mcclenahan@st        To:       <[EMAIL PROTECTED]> 
                                        
                      ellent.com>                 cc:                                  
                                        
                                                  Subject:  RE: Array complexType      
                                        
                      03/15/2002 10:46 AM                                              
                                        
                      Please respond to                                                
                                        
                      axis-user                                                        
                                        
                                                                                       
                                        
                                                                                       
                                        



The point is, I think I have a correct schema fragment, even after
reading the SOAP spec. This is why I think it is a bug with WSDL2Java. I
have posted before
http://marc.theaimsgroup.com/?l=axis-user&m=101465679419996&w=2 about a
NPE with WSDL2Java. After debugging I got around the error by changing
my schema as below. I think it is a correct schema, but I'm really not
100% sure. But as you can see when I make the call using Axis, I get
<item> instead of <option>, and I don't understand why.

I have had an exchange off-list with an Axis developer who believes my
schema is now correct. Does anyone else think otherwise? And like I
implied in my first post, a NPE is not very helpful in figuring out what
went wrong :-)

cheers,
             Simon


-----Original Message-----
From: St-Germain, Sylvain [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 15, 2002 7:41 AM
To: [EMAIL PROTECTED]
Subject: RE: Array complexType


Have a look at www.w3.org/TR/soap section 5.4.2 Arrays
Sylvain.

-----Original Message-----
From: Simon McClenahan [mailto:[EMAIL PROTECTED]]
Sent: Thursday, March 14, 2002 5:20 PM
To: Axis User (E-mail)
Subject: Array complexType


In my WSDL embedded Schema I have:

...
<complexType name="ArrayOfOption">
             <complexContent>
                         <restriction base="soapenc:Array">
                                     <sequence>
                                                 <element name="option"
type="tns:Option"
minOccurs="0" maxOccurs="unbounded"/>
                                     </sequence>
                         </restriction>
             </complexContent>
</complexType>

<complexType name="Option">
             <all>
                         <element name="name" type="string"/>
                         <element name="value" type="string"/>
             </all>
</complexType>
...


After WSDL2Java and making a call, the request shows:

...
   <options xsi:type="SOAP-ENC:Array"
SOAP-ENC:arrayType="ns1:Option[5]">
    <item xsi:type="ns1:Option">
     <name xsi:type="xsd:string">template</name>
     <value xsi:type="xsd:string">D:\templates\template1.htm</value>
    </item>
    <item xsi:type="ns1:Option">
...




I am expecting an <option> tag instead of an <item> tag. This happens
both with and without multiref enabled. Bug?

cheers,
             Simon

This message may contain privileged and/or confidential information.  If
you
have received this e-mail in error or are not the intended recipient,
you
may not use, copy, disseminate or distribute it; do not open any
attachments, delete it immediately from your system and notify the
sender
promptly by e-mail that you have done so.  Thank you.



Reply via email to