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 Jigsaw <ji...@hotmail.com> on 2004/07/21 15:10:49 UTC

Help with soap-enc:array

Hi,

    I have the following in my schema:
    
<simpleType name="ValidNameStrings">
   <restriction base="xsd:string">
      <enumeration value="string1"/>
      <enumeration value="string2"/>
      <enumeration value="string3"/>
   </restriction>
</simpleType>
<complexType name="nameStrings">
     <sequence>
        <element name="item" type="tns:ValidAppNames" minOccurs="0"
maxOccurs="3"/>
     </sequence>
</complexType>
<complexType name="ArrayOfNames">
   <restriction base="soapenc:Array">
       <attribute ref="soapenc:arraytype"
wsdl:arrayType="tns:nameStrings[]"/>
    </restriction>
</complexType>
<conplexType name="input">
    <sequence>
        <element name="names" type="tns:ArrayOfNames"/>
        <element name="term" type="xsd:String"/>
    </sequence>
</complexType>



The above is a part of my wsdl. When I use WSDL2Java, what .java files can I
expect? I seem to get only ArrayOfNames.java which has the following
methods:
Equals, hashcode, a custom serializer and a deserializer. There is no
reference to the ValidNameStrings and nameStrings array. What has gone
wrong?

Would appreciate any help.
Thanks in advance,
JS.


Re: Help with soap-enc:array

Posted by Jigsaw <ji...@hotmail.com>.
Hi again,


    I have been trying hard to get over this problem and finally tried this:

> <simpleType name="ValidNameStrings">
>  <restriction base="xsd:string">
>     <enumeration value="string1"/>
>     <enumeration value="string2"/>
>     <enumeration value="string3"/>
>  </restriction>
    <complexType name="ArrayOfNames">
        <sequence>
            <element name="item" type="tns:ValidNameStrings" maxOccurs=3"/>
        </sequence>
    </complexType>
> <complexType name="input">
>   <sequence>
>       <element name="names" type="tns:ArrayOfNames"/>
>       <element name="crc" type="xsd:boolean"/>
>   </sequence>
> </complexType>   


    I used WSDL2Java and obtained ArrayofNames.java, ValidNameStrings.java
and input.java.

I wrote a client to use the stubs and have been using tcpmon to see what
goes on the wire:

<soapenv:Body>
  <ns1:doTest 
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
                  xmlns:ns1="http://localhost/cgi-bin/Test.cgi">
   <params href="#id0"/>
  </ns1:doTest>
  
  <multiRef id="id0" soapenc:root="0"
                   
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
                          xsi:type="ns2:input"
                   
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
                          xmlns:ns2="http://localhost/Test.xsd">
   <names href="#id1"/>
   <crc xsi:type="xsd:boolean">true</crc>
  </multiRef>
  
  <multiRef id="id1" soapenc:root="0"
                   
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
                          xsi:type="ns3:ArrayOfNames"
                          xmlns:ns3="http://localhost/Test.xsd"
                   
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
   <item href="#id2"/>
   <item href="#id3"/>
  </multiRef>
  <multiRef id="id2" soapenc:root="0"
                   
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
                      xsi:type="ns4:ValidAppNames"
                      xmlns:ns9="http://localhost/Test.xsd"
                   
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">string1</multiRef>
                   
  <multiRef id="id3" soapenc:root="0"
                   
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
                      xsi:type="ns5:ValidAppNames"
                      xmlns:ns5="http://localhost/Test.xsd"
                   
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">string2</multiRef>
 </soapenv:Body>




But the above is not what I want.
I know this mail is particularly long. Please bear with me :-(
I expect to send something like

<input>
    <names>
        <item>string1</item>
        <item>string2</item>
    </names>
    <crc> true</crc>
</input>


How do I do this? 

Regards,
JS

On 21/7/04 2:10 pm, "Jigsaw" <ji...@hotmail.com> wrote:

> Hi,
> 
>   I have the following in my schema:
>   
> <simpleType name="ValidNameStrings">
>  <restriction base="xsd:string">
>     <enumeration value="string1"/>
>     <enumeration value="string2"/>
>     <enumeration value="string3"/>
>  </restriction>
> </simpleType>
> <complexType name="nameStrings">
>    <sequence>
>       <element name="item" type="tns:ValidAppNames" minOccurs="0"
> maxOccurs="3"/>
>    </sequence>
> </complexType>
> <complexType name="ArrayOfNames">
>  <restriction base="soapenc:Array">
>      <attribute ref="soapenc:arraytype"
> wsdl:arrayType="tns:nameStrings[]"/>
>   </restriction>
> </complexType>
> <conplexType name="input">
>   <sequence>
>       <element name="names" type="tns:ArrayOfNames"/>
>       <element name="term" type="xsd:String"/>
>   </sequence>
> </complexType>
> 
> 
> 
> The above is a part of my wsdl. When I use WSDL2Java, what .java files can I
> expect? I seem to get only ArrayOfNames.java which has the following
> methods:
> Equals, hashcode, a custom serializer and a deserializer. There is no
> reference to the ValidNameStrings and nameStrings array. What has gone
> wrong?
> 
> Would appreciate any help.
> Thanks in advance,
> JS.
> 
>