cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dongfeng Lu <>
Subject Is there a way to control the depth of recursiveness in @QueryParam?
Date Sat, 28 May 2016 22:39:46 GMT
I am using CXF 3.1.4.

I searched for "queryparam" and "recursive" in the user group archive and found discussions
related to JIRA ticket CXF-2153. I understand its purpose, but this recursiveness does not
work well for certain classes like javax.xml.datatype.XMLGregorianCalendar.

I defined my data structure in XSD like 
      <xsd:complexType name="RetrieveRequestType">
            <xsd:attribute name="start" type="xsd:dateTime" use="required" />
            <xsd:attribute name="end" type="xsd:dateTime" use="required" />
            <xsd:attribute name="count" type="xsd:nonNegativeInteger" />

      <xsd:element name="Retrieve">
                        <xsd:extension base="p1:RetrieveRequestType"

In the generated Java files, "xsd:dateTime" is represented by XMLGregorianCalendar class.
I then defined an interface like 
      @Produces({ MediaType.APPLICATION_JSON })
      public RetrieveResponseType retrieve(@QueryParam("") Retrieve message) ;

The generated WADL has the following resource definition
            <resource path="retrieve">
                <method name="GET">
                        <param name="count" style="query" />
                        <param name="" style="query" type="xs:int"
                        <param name="end.month" style="query" type="xs:int"
                        <param name="end.year" style="query" type="xs:int"
                        <param name="end.valid" style="query" type="xs:boolean"
                        <param name="end.hour" style="query" type="xs:int"
                        <param name="end.minute" style="query" type="xs:int"
                        <param name="end.second" style="query" type="xs:int"
                        <param name="end.eon" style="query" />
                        <param name="end.eonAndYear" style="query" />
                        <param name="end.fractionalSecond" style="query"
                        <param name="end.millisecond" style="query" type="xs:int"
                        <param name="end.xMLSchemaType.namespaceURI"
style="query" type="xs:string" />
                        <param name="end.xMLSchemaType.prefix" style="query"
type="xs:string" />
                        <param name="end.xMLSchemaType.localPart" style="query"
type="xs:string" />
                        <param name="end.timezone" style="query" type="xs:int"
                        <param name="" style="query" type="xs:int"
                        <param name="start.month" style="query" type="xs:int"
                        <param name="start.year" style="query" type="xs:int"
                        <param name="start.valid" style="query" type="xs:boolean"
                        <param name="start.hour" style="query" type="xs:int"
                        <param name="start.minute" style="query" type="xs:int"
                        <param name="start.second" style="query" type="xs:int"
                        <param name="start.eon" style="query" />
                        <param name="start.eonAndYear" style="query"
                        <param name="start.fractionalSecond" style="query"
                        <param name="start.millisecond" style="query"
type="xs:int" />
                        <param name="start.xMLSchemaType.namespaceURI"
style="query" type="xs:string" />
                        <param name="start.xMLSchemaType.prefix" style="query"
type="xs:string" />
                        <param name="start.xMLSchemaType.localPart" style="query"
type="xs:string" />
                        <param name="start.timezone" style="query" type="xs:int"
                        <representation mediaType="application/json"
                            element="prefix1:RetrieveResponseType" />

And CXF JAXRSClientFactory.create() generated client sends the following URL to the server


Clearly this is not what I wanted. I wanted simple queries like




With a customized ParamConverter for XMLGregorianCalendar both simplified queries work well
if I just send them directly to the server. However, the WADL is still wrong, and I could
not find way to have CXF client to send correct URLs to the server.

I believe this is the side effect of the fix for CXF-2153 ticket. Is there a way to configure
it so it only goes down one level into Retrieve class, and not into its components' XMLGregorianCalendar


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