Hi,

I'm experiencing a rather strange problem using the latest version of
CXF. I'm creating a web service by generating code from a hand-written
WSDL which works fine in all our tests, but now we have received a
notification from one of our customers that the WSDL that is outputted
does not appear to be correct.

Example:

<xsd:element name="company" maxOccurs="unbounded" minOccurs="0">
        <xsd:complexType>
                <xsd:sequence>
                        <xsd:element name="name" type="xsd:string"/>
                        <xsd:element name="category" type="xsd:string"/>
                </xsd:sequence>
        </xsd:complexType>
</xsd:element>

This is an example of a declared element that has a sequence (= is
implemented as a list in the generated code). It has minOccurs="0"
specified, but when I append ?wsdl to the web service to get its WSDL, I
notice that this attribute as been removed. That is, it is identical to
the element above, save for minOccurs="0".

This is not an isolated case, but all of our elements specified in this
way "suffer" from this.

At first, I figured it didn't matter because minOccurs="0" might be the
default value anyway, but after checking the specification it seems like
both minOccurs and maxOccurs has a default value of 1, which means that
the generated service is not identical to the WSDL I generated from.

Now, I have successfully verified that I *can* send a list with zero
entries so I know that CXF regards the list as being from 0 to unbounded
internally, but seeing as the specification says 1 is default, I have to
assume that depending on the framework you are using to generate access
code, it is very much possible that code is generated that refuse to
validate without at least one entry.

Without going into more detail than this, has anyone else experienced
this? Am I wrong in regard to the specification, or did I perhaps
declare the element wrong in the WSDL?

Thanks in advance,
Matthias Karlsson

Reply via email to