WSDL: schema minOccurs="0", maxOccurs="unbounded", ...

From: Pedro Salazar <pedro-b-salazar_at_PTINOVACAO.PT>
Date: Fri, 28 Mar 2003 10:43:57 +0000


I think it's not possible to define a message parameter that is optional
(like the 'minOccurs="0"' in element schema). So, the only workaround is
to wrap the element in another element and make that the occurrences of
that element may be 0 (zero).

<element name="WrapElement" type="WrapElementType" />
<complexType name="WrapElementType">
        <element name="parameter" type="string"
                minOccurs="0" maxOcurrs="1"/>

<message name="myMessage">
        <part name="parameter" element="ns2:WrapElement"/>

But, how Java mapping handle the 0 occurrences of one element? How
should we know that the element could be 0? It only matters for the SOAP
message and the Java part the object exists always even if it is null?

If the minim occurrences would be 1, it means if I try to pass a object
a null I would get a exception on the binding?

And the maxOccurs?

Pedro Salazar.