To me, the wrapper element must be a sequence that only contains elements, nothing else. I think CXF is doing the right thing.
Dan > On Mar 27, 2019, at 5:29 AM, Jim Ma <mail2ji...@gmail.com> wrote: > > Hi Dan and Colm, > Do you have any thoughts on this ? > Thanks, > Jim > > On Wed, Mar 6, 2019 at 2:26 PM Jim Ma <mail2ji...@gmail.com> wrote: > >> When I tried wsdl2java tool to generate this wrapper element and the >> output is a doc-lit-bare style method : >> <xsd:element name="hello"> >> <xsd:complexType> >> <xsd:complexContent> >> <xsd:extension base=""tns:baseType"> >> <xsd:sequence> >> <xsd:element name="id" >> type="tns:idType" minOccurs="1" maxOccurs="1" /> >> <xsd:choice> >> <xsd:element name="updateName" >> type="tns:newNameType" maxOccurs="1" >> minOccurs="0" /> >> <xsd:element name="newName" type="tns:newNameType" >> minOccurs="0" maxOccurs="1" /> >> </xsd:choice> >> </xsd:sequence> >> </xsd:extension> >> </xsd:complexContent> >> </xsd:complexType> >> </xsd:element> >> >> CXF takes this is a bare style if it finds there is <xsd:choice> nested in >> <xsd:sequence> and this breaks the rule(v) in jaxws sepc: >> A WSDL operation qualifies for wrapper style mapping only if the following >> criteria are met: >> (i) The operation’s input and output messages (if present) each contain >> only a single part >> (ii) The input message part refers to a global element declaration whose >> local name is equal to the operation name >> (iii) The output message (if present) part refers to a global element >> declaration >> (iv) The elements referred to by the input and output message(if present) >> parts (henceforth referred to as wrapper elements) are both complex types >> defined using the xsd:sequence compositor >> (v) The wrapper elements only contain child elements, they MUST not >> contain other structures such as wildcards (element or attribute), >> xsd:choice, substitution groups (element references are not permitted) or >> attributes; furthermore, they MUST not be nillable >> >> Do you think the rule(v) should be interpreted to there should be only >> <xsd:squence> defined for complex type and <xsd:choice> is not allowed here >> like : >> <xsd:element name="p"> >> <xsd:complexType> >> <xsd:choice> >> <xsd:element name="choice1" maxOccurs="1" minOccurs="0"/> >> <xsd:element name="choice2 maxOccurs="1" minOccurs="1"/>. >> </xsd:complexType> >> </xsd:element> >> >> then <xsd:sequence> child element <xsd:choice> is allowed for wrapped >> style ? >> >> Cheers, >> Jim >> >> >> >> Cheers, >> Jim >> >> -- Daniel Kulp dk...@apache.org <mailto:dk...@apache.org> - http://dankulp.com/blog <http://dankulp.com/blog> Talend Community Coder - http://talend.com <http://coders.talend.com/>