Have you tried doing java2wsdl. If you are able to represent what you want
in a java bean class then java2wsdl would generate the proper wsdl for you.
And then you can generate client stubs from that wsdl if you need to.


-----Original Message-----
From: Jigsaw [mailto:[EMAIL PROTECTED] 
Sent: Thursday, July 22, 2004 9:01 AM
To: [EMAIL PROTECTED]
Subject: Re: Help with soap-enc:array

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" <[EMAIL PROTECTED]> 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.
> 
> 

Reply via email to