Michael,

First let me explain the problem with your original schema -- it was not
valid. You specified:

<wsdl:types>
   <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema";
      attributeFormDefault="qualified" elementFormDefault="qualified"
      targetNamespace="http://quickstart.samples/xsd";>
   <xs:element name="MyArray">
      <xs:complexType>
         <xs:element name="My" minOccurs="1" maxOccurs="unbounded" />
            <xs:sequence>
            <xs:element name="MyOne" type="xs:string" />
            <xs:element name="MyTwo" type="xs:string" />
            <xs:element name="MyThree" type="xs:string" />
         </xs:sequence>
      </xs:complexType>
   </xs:element>
   </xs:schema>
</wsdl:types>

but, you can't define the "My" element immediately after the
<xs:complexType>, and then you can't define an <xs:sequence> immediately
after the "My" element. Amila provided a correction by defining named types
(my preference), but if you wanted to use anonymous types, you would need to
define it like this:

<wsdl:types>
   <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema";
attributeFormDefault="qualified" elementFormDefault="qualified"
targetNamespace="http://quickstart.samples/xsd";>
   <xs:element name="MyArray">
      <xs:complexType>
         <xs:sequence>
           <xs:element name="My" minOccurs="1" maxOccurs="unbounded" >
             <xs:complexType>
               <xs:sequence>
                 <xs:element name="MyOne" type="xs:string" />
                 <xs:element name="MyTwo" type="xs:string" />
                 <xs:element name="MyThree" type="xs:string" />
               </xs:sequence>
             </xs:complexType>
           </xs:element>
         </xs:sequence>
      </xs:complexType>
   </xs:element>
   </xs:schema>
</wsdl:types>

As for "multipart" message support -- based on the example you provided in
your question, I assume you are asking whether Axis2 supports multiple parts
in an input or output message. This capability depends on the SOAP message
style you're using. If you are using "document" style, then the message may
contain only one message part in the SOAP body. That message part represents
the "document" that you are sending in the message. If you want to send
multiple XML fragments, then you must define a wrapper element that
encompasses all your fragments into a single element. (You may define
additional message parts that will be conveyed in the SOAP header, but
typically you define header parts using WS-Policy rather than the WSDL.)
This is a SOAP protocol constraint of the "document" style, not an Axis2
constraint. The SOAP Body may convey only one child element. If you are
using "rpc" style, then you can specify any number of message parts -- each
part representing a "parameter" in the RPC message. At runtime, Axis2
automatically generates a single wrapping element that encompasses the
parameters, so that the SOAP Body still conveys only one child element.

Hope that helps.

Anne

On 6/30/07, Michael Potter <[EMAIL PROTECTED]> wrote:

Amila,

Thanks for this reply.  I will use this information.

I think the confusion (on my part or yours, does not matter tho ;) is
that I posted two different questions.

My minoccurs in sequence question has been answered.

My multipart message question was not answered.  I will add some
sample code to that thread on monday when I am back at work.  from
memory:

<message name=xxx>
   <part name=part1 element=xxx/>
   <part name=part2 element=yyy/>
</message>

gives this error:
SEVERE:
org.apache.axis2.description.WSDL11ToAxisServiceBuilder$WSDLProcessingException:
More than one part for message XXXX

Thanks a bunch.

--
Michael Potter


On 6/28/07, Amila Suriarachchi <[EMAIL PROTECTED]> wrote:
> I am not sure what you mean by multipart messages? can you
> give an sample schema?
>
> Actually I have not gone through your initial mail clearly and just
reply
> seen the subject .
>
> There you have given,
>
>  <xs:element name="MyArray">
>         <xs:complexType>
>            <xs:element name="My" minOccurs="1" maxOccurs="unbounded" />
>               <xs:sequence>
>               <xs:element name="MyOne" type="xs:string" />
>               <xs:element name="MyTwo" type="xs:string" />
>               <xs:element name="MyThree" type="xs:string" />
>            </xs:sequence>
>         </xs:complexType>
>      </xs:element>
>
> Is this schema valid? I think you can not declare and element just after
a
> complex Type.
> What I mean was ADB supports following types of schema now
>
> <xs:element name="MyArray">
>         <xs:complexType>
>              <xs:sequence minOccurs="1" maxOccurs="unbounded" >
>             <xs:element name="My" />
>               <xs:element name="MyOne" type="xs:string" />
>               <xs:element name="MyTwo" type="xs:string" />
>               <xs:element name="MyThree" type="xs:string" />
>            </xs:sequence>
>         </xs:complexType>
>      </xs:element>
>
> in you first mail you have said
>
> ADB databinding does not support minOccurs and maxOccurs attributes in
> sequence and choice elements ( i.e., <sequence minOccurs="0"
> maxOccurs="unbounded"><
> /sequence>)
>
> This is true for Axis2 1.2. but now we have added this feature.
>
> Amila.
>
>
>
>
> On 6/29/07, Michael Potter <[EMAIL PROTECTED]> wrote:
> > Are you saying that ADB now supports multipart messages?
> >
> > On 6/28/07, Amila Suriarachchi <[EMAIL PROTECTED]> wrote:
> > > hi,
> > > sorry for late reply.
> > > ADB now supports this feature. Please have a look at with a nighly
> build.
> > >
> > >
> > > On 6/28/07, Michael Potter < [EMAIL PROTECTED]> wrote:
> > > > Thanks,
> > > > That looks like it is going to work.
> > > >
> > > > I am rethinking how I am organizing my wsdl.  I will move to using
> > > > complexTypes for everything, even if it does not have multiple
> > > > occurances.  That will solve my other problem which is Axis' lack
of
> > > > support for multi-part messages.
> > > >
> > > > --
> > > > Michael Potter
> > > >
> > > > On 6/26/07, Ali, Haneef < [EMAIL PROTECTED]> wrote:
> > > > >
> > > > > I believe this should work
> > > > >
> > > > >
> > > > >   <xs:complexType name="MyType" />
> > > > >        <xs:sequence>
> > > > >             <xs:element name="MyOne" type="xs:string" />
> > > > >              <xs:element name="MyTwo" type="xs:string" />
> > > > >              <xs:element name="MyThree" type="xs:string" />
> > > > >         </xs:sequence>
> > > > >   </xs:complexType>
> > > > >
> > > > >   <xs:complexType name="MyArrayType">
> > > > >        <xs:sequence>
> > > > >             <xs:element name="My" type="MyType" minOccurs="1"
> > > maxOccurs="unbounded" />
> > > > >        <xs:sequence>
> > > > >   </xs:complexType>
> > > > >
> > > > >   <xs:element name="MyArray" type="MyArrayType" />
> > > > >
> > > > >
> > > > > Thanks,
> > > > >
> > > > > Haneef
> > > > >
> > > > > -----Original Message-----
> > > > > From: Michael Potter [mailto: [EMAIL PROTECTED]
> > > > > Sent: Tue 6/26/2007 5:22 PM
> > > > > To: axis-user@ws.apache.org
> > > > > Subject: Re: minoccurs in sequence
> > > > >
> > > > > mmm,
> > > > >
> > > > > As an exercise to communicate what I want the schema to do it
will
> be
> > > valuable:
> > > > >
> > > > >     <MyArray>
> > > > >           <My>
> > > > >              <MyOne>some data 1</MyOne>
> > > > >              <MyTwo>some data 2</MyTwo>
> > > > >              <MyThree>some data 3</MyThree>
> > > > >           </My>
> > > > >           <My>
> > > > >              <MyOne>more data 1</MyOne>
> > > > >              <MyTwo>more data 2</MyTwo>
> > > > >              <MyThree>more data 3</MyThree>
> > > > >           </My>
> > > > >           ...
> > > > >     </MyArray>
> > > > >
> > > > > --
> > > > > Michael Potter
> > > > >
> > > > > On 6/26/07, Ali, Haneef <[EMAIL PROTECTED]> wrote:
> > > > > > Hi,
> > > > > >
> > > > > > Can you post the actual xml fragment you want to generate? I
don't
> > > think
> > > > > > your schema is correct. Axis document says that it can't
support
> > > > > > minOccurs in sequence. It supports minOccurs in element.
> > > > > >
> > > > > >  <sequence minOccurs="0"
> > > maxOccurs="unbounded"></sequence>  --- Not
> > > > > > supported
> > > > > >
> > > > > >  <xs:element name="My" minOccurs="1" maxOccurs="unbounded" />
--
> Is
> > > > > > supported
> > > > > >
> > > > > > Haneef
> > > > > >
> > > > > > -----Original Message-----
> > > > > > From: Michael Potter [mailto:[EMAIL PROTECTED]
> > > > > > Sent: Tuesday, June 26, 2007 4:08 PM
> > > > > > To: axis-user@ws.apache.org
> > > > > > Subject: minoccurs in sequence
> > > > > >
> > > > > > I am looking for alternatives to support multiple occurances.
> > > > > >
> > > > > > I have WSDL that looks like this:
> > > > > > -------------------------
> > > > > > <wsdl:types>
> > > > > >      <xs:schema
> > > xmlns:xs=" http://www.w3.org/2001/XMLSchema";
> > > > > > attributeFormDefault="qualified"
> > > elementFormDefault="qualified"
> > > > > > targetNamespace=" http://quickstart.samples/xsd";>
> > > > > >      <xs:element name="MyArray">
> > > > > >         <xs:complexType>
> > > > > >            <xs:element name="My" minOccurs="1"
> maxOccurs="unbounded"
> > > />
> > > > > >               <xs:sequence>
> > > > > >               <xs:element name="MyOne" type="xs:string" />
> > > > > >               <xs:element name="MyTwo" type="xs:string" />
> > > > > >               <xs:element name="MyThree" type="xs:string" />
> > > > > >            </xs:sequence>
> > > > > >         </xs:complexType>
> > > > > >      </xs:element>
> > > > > >      </xs:schema>
> > > > > >   </wsdl:types>
> > > > > > -------------------------
> > > > > >
> > > > > > When I run:
> > > > > > -------------------------
> > > > > > ksh $AXIS2_HOME/bin/wsdl2java.sh -uri ./MySample.wsdl -p
> > > > > > samples.quickstart -o . -d adb -s -wv 1.1 -ss -sd
> > > > > > -------------------------
> > > > > >
> > > > > > The java code that gets generated does not support multiple
> occurances
> > > > > > of this type.
> > > > > >
> > > > > > Which seems to be expected because of this limitation listed
on
> > > > > > http://ws.apache.org/axis2/:
> > > > > > --------------------------
> > > > > > ADB databinding does not support minOccurs and maxOccurs
> attributes in
> > > > > > sequence and choice elements (i.e., <sequence minOccurs="0"
> > > > > > maxOccurs="unbounded"></sequence>)
> > > > > > --------------------------
> > > > > >
> > > > > > What are my alternatives to support multiple occurances?
> > > > > >
> > > > > > Do I have to put min/maxoccurs on each element?
> > > > > >
> > > > > > Can I just remove sequence and have it generate java that
support
> > > > > > multiple occurances?
> > > > > >
> > > > > > Can wsdl2java be configured to report this and similar errors?
> > > > > >
> > > > > > --
> > > > > > Michael Potter
> > > > > >
> > > > > >
> > >
> ---------------------------------------------------------------------
> > > > > > To unsubscribe, e-mail:
> > > [EMAIL PROTECTED]
> > > > > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > > > >
> > > > > >
> > > > > >
> > >
> ---------------------------------------------------------------------
> > > > > > To unsubscribe, e-mail:
> > > [EMAIL PROTECTED]
> > > > > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > > > >
> > > > > >
> > > > >
> > > > >
> > >
> ---------------------------------------------------------------------
> > > > > To unsubscribe, e-mail:
> > > [EMAIL PROTECTED]
> > > > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > > >
> > > > >
> > > > >
> > > > >
> > >
> ---------------------------------------------------------------------
> > > > > To unsubscribe, e-mail:
> > > [EMAIL PROTECTED]
> > > > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > > >
> > > > >
> > > >
> > > >
> > >
> ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail:
> > > [EMAIL PROTECTED]
> > > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > >
> > > >
> > >
> > >
> > >
> > > --
> > > Amila Suriarachchi,
> > > WSO2 Inc.
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
>
>
> --
> Amila Suriarachchi,
> WSO2 Inc.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Reply via email to