I think I have figured out the problem.  In this case, there is an
anonymous complex type with a sequence.  That sequence has an implied
minOccurs of 1.  But, inside that sequence is only a single item, any,
with a minOccurs of 0.  The ADB deserializer didn't handle the case
where the any had nothing, since the sequence was expecting at least 1
item.  I worked around it by adding minOccurs=0 to the sequence.  I
don't know how the specification says to handle this, but it may be that
if all the subitems have minOccurs=0, then the parent should also be
treated as though minOccurs=0 as well.

Thanks,

-David

 

________________________________

From: Dimuthu Gamage [mailto:[EMAIL PROTECTED] 
Sent: Monday, November 17, 2008 10:04 PM
To: Apache AXIS C User List
Subject: Re: xs:any minOccurs Check is Wrong

 

Hi David,

>From the error message of your generated code, it looks like you are
checking "ItemListTypeSequence" instead of "ItemListType" property. Can
you check whether there is anther property named "ItemListType"?.

If it is no other property, then this should probably bugs for not
setting @any and @minOccurs. If so please report it to the Apache Jira.
https://issues.apache.org/jira/secure/Dashboard.jspa (select Axis2-C
project)

Thanks
Dimuthu

On Wed, Nov 12, 2008 at 4:29 AM, David Taylor (Lowell) <[EMAIL PROTECTED]>
wrote:

I have a WSDL that I am using to generate ADB stubs.  This WSDL includes
a type with xs:any that is causing the stub to have code generated to
check for at least 1 element in the list, even though the element lists
minOccurs="0".  Here's the fragment of the WSDL:

 

 

            <complexType name="ItemListType">

                        <sequence maxOccurs="unbounded">

                                    <any namespace="##other"
processContents="lax" minOccurs="0" maxOccurs="unbounded" />

                        </sequence>

            </complexType>

 

Here is the erroneous check in the generated stub deserialize function:

 

                                   if (i < 1)

                                   {

                                     /* found element out of order */

                                     AXIS2_LOG_ERROR(env->log,
AXIS2_LOG_SI, "ItemListTypeSequence (@minOccurs = '1') only have %d
elements", i);

                                     if(element_qname)

                                     {

                                        axutil_qname_free(element_qname,
env);

                                     }

                                     if(arr_list)

                                     {

                                        axutil_array_list_free(arr_list,
env);

                                     }

                                     return AXIS2_FAILURE;

                                   }

 

The problem appears to be that the XSLT stylesheet is looking for an
@any attribute to be set, to avoid generating this section of code.  It
seems that the xs:any element should set this attribute.  However, I
can't figure out where that attribute should be set.  Any help would be
greatly appreciated.

Thanks,

-David

 




-- 
Thanks,
Dimuthu Gamage

http://www.dimuthu.org
http://www.wso2.org

Reply via email to