[Xml-compile] Elements with maxOccurs="100"
Zbigniew Lukasiak
zzbbyy at gmail.com
Mon Nov 24 12:07:16 GMT 2008
Thanks for such a quick reply!
On Mon, Nov 24, 2008 at 12:41 PM, Mark Overmeer <mark at overmeer.net> wrote:
> * 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?
This was my mistake in copy-pasting. I've tried many versions - but
this is not relevant.
>
> Another suspectable thing is that you use "nillable"... which means that
> "undef"s will get encoded into xsi:nil attributes. You really need that?
Thanks - this was the problem! I changed nillable to 'false' and now
it works. I think that with nillable="true" it expected a 100
elements array - maybe it is a good idea for a more explicite error
message.
> 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
>
>
--
Zbigniew Lukasiak
http://brudnopis.blogspot.com/
http://perlalchemy.blogspot.com/
More information about the Xml-compile
mailing list