Brendan-

write a bean class which will manually encapsulates all of the items as attrbutes of your bean class
Then implement the bean class in your wsdl as ComplexDatatype as in this example
<wsdl:types>
  <schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://weather">
   <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
   <complexType name="YourComplexDataType">
    <sequence>
     <element name="zip" nillable="true" type="xsd:string"/>

great example located here
Martin
 
This e-mail communication and any attachments may contain confidential and privileged information for the use of the
designated recipients named above. If you are not the intended recipient, you are hereby notified that you have received
this communication in error and that any review, disclosure, dissemination, distribution or copying of it or its
contents
----- Original Message -----
Sent: Wednesday, October 11, 2006 3:34 PM
Subject: problem with wsdl2java

I am having a problem with the generated code from wsdl2java if I have a complexType with one element and several attributes. Here is my complexType

 

            <complexType name="SomeData">

                        <sequence>

                                    <element name="data" type="string" maxOccurs="unbounded"/>

                        </sequence>

                        <attribute name="attr1" type="boolean" default="false"/>

                        <attribute name="attr2" type="boolean" default="true"/>

                        <attribute name="attr3" type="boolean" default="true"/>

            </complexType>

           

What happens is no code is generated for the SomeData class and if I include the element of type SomeData in another type, the generated code shows up as String[] data, so I only get the element. If I add a 2nd element to the sequence (see below) then I get a SomeData class generated and this has the elements and attributes in it. I am using Axis 1.3 (I believe RC2, I downloaded it a while ago).

 

            <complexType name="SomeData">

                        <sequence>

                                    <element name="data" type="string" maxOccurs="unbounded"/>

                                    <element name="elem2" type="string"/>

                        </sequence>

                        <attribute name="attr1" type="boolean" default="false"/>

                        <attribute name="attr2" type="boolean" default="true"/>

                        <attribute name="attr3" type="boolean" default="true"/>

            </complexType>

 

Let me know if this is a known problem that may have been fixed in a later release or if I am doing something wrong.

 

Thanks,

Brendan Flood,

 

 

Reply via email to