chemistry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dalibor Jacko2" <>
Subject ref element not allowed
Date Wed, 05 Apr 2017 12:58:32 GMT


I think I have found a bug. I'm using apache-cxf and cannot use query
operation from generated class DiscoveryServicePort
( chemistry-opencmis-commons-impl-0.10.0.jar ). I have found workaround.

It is necessary to edit file directly in library distribution
under xml node
<xs:element name="query">
remove <xs:attributeGroup ref="cmis:cmisUndefinedAttribute" /> line 1756

Let me explain how this workaround works.
DiscoveryServicePort contain query method with 9 parameters. This mean that
it is expected WRAPPED style. According to JAX-WS specification it is not
allowed to use "ref" attribute when you want to use Wrapper soap style.
Since 'ref' attribute is presented apache-cxf believe that query method
will have only one parameter (NON-WRAPPED style) and failed to map values
to parameters.

According to DiscoveryServicePort interface included in library
distribution you are expected Wrapped style.
\org.apache.chemistry.opencmis.commons.impl.jaxb.DiscoveryServicePort query
method have nine 'in' parameters

public interface DiscoveryServicePort {
@WebMethod(action = "query")
@WebResult(name = "objects", targetNamespace = "")
@RequestWrapper(localName = "query", targetNamespace = "", className =
@ResponseWrapper(localName = "queryResponse", targetNamespace = "", className =
public CmisObjectListType query(
    @WebParam(name = "repositoryId", targetNamespace = "")
    String repositoryId,
    @WebParam(name = "statement", targetNamespace = "")
    String statement,
    @WebParam(name = "searchAllVersions", targetNamespace = "")
    Boolean searchAllVersions,
    @WebParam(name = "includeAllowableActions", targetNamespace = "")
    Boolean includeAllowableActions,
    @WebParam(name = "includeRelationships", targetNamespace = "")
    EnumIncludeRelationships includeRelationships,
    @WebParam(name = "renditionFilter", targetNamespace = "")
    String renditionFilter,
    @WebParam(name = "maxItems", targetNamespace = "")
    BigInteger maxItems,
    @WebParam(name = "skipCount", targetNamespace = "")
    BigInteger skipCount,
    @WebParam(name = "extension", targetNamespace = "")
    CmisExtensionType extension)
    throws CmisException

Since there is not allowed 'ref' attribute Apache-cxf will try to handle
'soap message marshaling' with non-wrapped style (BARE style) only one 'in'

public interface DiscoveryServicePort {
@WebMethod(action = "query")
@SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
@WebResult(name = "queryResponse", targetNamespace = "", partName =
public query(
    @WebParam(partName = "parameters", name = "query", targetNamespace = "") parameters
) throws CmisException;


I'm attaching few more information directly from JAX-WS specification :

page 14 Wrapper Style
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
localname is equal to the operation
(iii) The output message (if present) part refers to a global element
(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
(v) The wrapper elements only contain child elements, they MUST not contain
other structures such
as wildcards (element or attribute), xsd:choice, substitution groups (


 or attributes; furthermore, they MUST not be nillable.
♦ Conformance (Default mapping mode): Operations that do not meet the
criteria above MUST be mapped
using non-wrapper style.



<xs:element name="query">
                <xs:element name="repositoryId" type="xs:string"
                    minOccurs="1" maxOccurs="1" />
                <xs:element name="statement" type="xs:string" minOccurs="1"
                    maxOccurs="1" />
                <xs:element name="searchAllVersions" type="xs:boolean"
                    minOccurs="0" maxOccurs="1" nillable="true" />
                <xs:element name="includeAllowableActions"
                    minOccurs="0" maxOccurs="1" nillable="true" />
                <xs:element name="includeRelationships"
                    minOccurs="0" maxOccurs="1" nillable="true" />
                <xs:element name="renditionFilter" type="xs:string"
                    minOccurs="0" maxOccurs="1" nillable="true" />
                <xs:element name="maxItems" type="xs:integer" minOccurs="0"
                    maxOccurs="1" nillable="true" />
                <xs:element name="skipCount" type="xs:integer"
                    maxOccurs="1" nillable="true" />
                <xs:element name="extension" type="cmism:cmisExtensionType"
                    minOccurs="0" maxOccurs="1" nillable="true">
                            This is an extension element to hold any
                            repository or
                            vendor-specific extensions
       <!--     <xs:attributeGroup ref="cmis:cmisUndefinedAttribute" />
----------------------   not allowed with WRAPPING style-->


Dalibor Jacko 	 Slovakia
IBM Slovakia

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message