[Xml-compile] Elements with maxOccurs="100"

Mark Overmeer mark at overmeer.net
Mon Nov 24 11:41:15 GMT 2008


* Zbigniew Lukasiak (zzbbyy at gmail.com) [081124 11:27]:
> I need to send a list of elements (max 100):
> 
> <x0:sms-send-result>
> <x0:number>12341234</x0:number>
> <x0:idsms>3</x0:idsms>
> </x0:sms-send-result>
> 
> <x0:sms-send-result>
> <x0:number>1111111</x0:number>
> <x0:idsms>4</x0:idsms>
> </x0:sms-send-result>
> 
> So I added the following element to the WSDL definition:
> 
> <element name="sms-send-result" type="ns:sms-send-result"
> minOccurs="0" maxOccurs="100" nillable="true"/>
> 
> But then I get:
> 
> error: complex `x0:sms-send-result-list' requires data at
> {urn:calculator}sms-send-output/sms-send-result-list

Why does it complain about ...-list, where I do not see you define or
use that type?

Another suspectable thing is that you use "nillable"... which means that
"undef"s will get encoded into xsi:nil attributes.  You really need that?
It might be a but with that combination...  I'll check this now.

> when I try to send an array like that:
> 'sms-send-result' => [
>             {
>                 number => '12341234',
>                 idsms => 3,
>             },
> ]
> 
> When I change it back to maxOccurs="1" then sending:
> 
> 'sms-send-result' =>
>             {
>                 number => '12341234',
>                 idsms => 3,
>             },
> 
> works.
> 
> So my question is how should I specify this so that it would work with
> a list.

When everything is correctly defined and implemented, this would
be the way to specify it, yes.
-- 
Regards,
               MarkOv

------------------------------------------------------------------------
       Mark Overmeer MSc                                MARKOV Solutions
       Mark at Overmeer.net                          solutions at overmeer.net
http://Mark.Overmeer.net                   http://solutions.overmeer.net




More information about the Xml-compile mailing list