cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From namdets <namd...@gmail.com>
Subject Re: WADL Grammar section lost for generic service class.
Date Tue, 28 Apr 2015 00:23:49 GMT
Sergey,

That worked, thank you for all your help!

Jason

On Sun, Apr 26, 2015 at 4:06 PM, Sergey Beryozkin [via CXF] <
ml-node+s547215n5756546h1@n5.nabble.com> wrote:

> Hi
>
> Good it is working for you,
> Can you please re-enable that property, 'linkAnyMediaTypeToJson' ? That
> should do it.
>
> Sergey
> On 26/04/15 08:31, namdets wrote:
>
> > Sergey,
> >
> > Both 3.0.5-SNAPSHOT and 3.1.0-SNAPSHOT pass my tests. Thank you very
> much
> > for your work on CXF in general and particularly on this issue.
> >
> > I won't be needing any 2.7 support, onward and upward!
> >
> > One additional thing that I noticed was that the representation elements
> in
> > the generated WADL do not populate the element attribute(attribute
> called
> > 'element', argh!) unless the media type is applicaiton/xml. This is not
> > counter to the WADL spec, so is not a bug. However given that the spec
> does
> > not forbid element attributes on application/json media typed
> > representation elements, I would consider it a desirable feature in
> today's
> > more JSON oriented world. The implication here is that the wadl2java
> tool
> > could generate JSON clients that have correct response types in their
> > method stubs.
> >
> > There is a workaround here as always, but it isn't pretty. If we add
> > application/xml to our consumes/produces, we get something like this:
> >
> > <method name="PUT">
> > <request>
> > <representation mediaType="application/json"/>
> > <representation mediaType="aaplication/xml"
> element="prefix1:something"/>
> > </request>
> > <response>
> > <representation mediaType="application/json"/>
> > <representation mediaType="aaplication/xml"
> element="prefix1:something"/>
> > </response>
> > </method>
> > While this will produce a correctly typed stub, and is more flexible if
> you
> > ever might need XML support, in today's more JSON oriented world it
> feels
> > like noise.
> >
> > Again, thank you very much for your help!
> >
> > Jason
> >
> > On Fri, Apr 24, 2015 at 10:59 AM, Sergey Beryozkin [via CXF] <
> > [hidden email] <http:///user/SendEmail.jtp?type=node&node=5756546&i=0>>
> wrote:
> >
> >> Hi
> >>
> >> I've updated a bit the WADLGenerator code and added a test, should all
> >> work as expected now.
> >> Can you please try the snapshots ? Note I've only merged to
> >> 3.0.5-SNAPSHOT and 3.1.0-SNAPSHOT.
> >> Do you need it for CXF 2.7.x ?
> >> Thanks, Sergey
> >>
> >> On 22/04/15 11:08, Sergey Beryozkin wrote:
> >>
> >>> OK, may be something to do with figuring out what T is in List<T>,
I
> >>> thought it was all working fine after Francesco submitted few issues
> to
> >>> do with the WADL auto-generation awhile back.
> >>> I'll try to have a look before 3.0.5 gets out but I'm not sure yet
> I'll
> >>> have time - I'll investigate either way
> >>>
> >>> Thanks, Sergey
> >>> On 21/04/15 21:58, namdets wrote:
> >>>> Sergey,
> >>>>
> >>>> Thanks for getting back to me!
> >>>>
> >>>> I tried setting the linkAnyMediaTypeToXmlSchema property on my
> >>>> WadlGenerator
> >>>> like so:
> >>>>
> >>>>
> >>>>       <jaxrs:server id="services" address="/">
> >>>>           <jaxrs:serviceBeans>
> >>>>               <ref bean="companyRS"/>
> >>>>           </jaxrs:serviceBeans>
> >>>>           <jaxrs:providers>
> >>>>               <bean
> >> class="org.apache.cxf.jaxrs.model.wadl.WadlGenerator">
> >>>>                   <property name="linkAnyMediaTypeToXmlSchema"
> >>>> value="true"/>
> >>>>               </bean>
> >>>>               <bean
> >>>> class="com.fasterxml.jackson.jaxrs.json.JacksonJaxbJsonProvider"/>
> >>>>           </jaxrs:providers>
> >>>>       </jaxrs:server>
> >>>>
> >>>> Unfortunately this did not resolve the issue, is this the correct
> way?
> >>>>
> >>>> Some additional information:
> >>>>
> >>>> My DTOs are marked with @XmlRootElement as this has been required in
> >> the
> >>>> past to get any grammars included in the wadl for application/json
> >> media
> >>>> types, but I have tried removing this also.
> >>>>
> >>>> The wadl generation is complete with grammars if I put my resource
> >>>> methods
> >>>> directly in the FooRS instead of(or in addition to) the AbstractRS
> >>>> without
> >>>> making any other changes.
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>
> >>>> --
> >>>> View this message in context:
> >>>>
> >>
> http://cxf.547215.n5.nabble.com/WADL-Grammar-section-lost-for-generic-service-class-tp5755870p5756379.html
> >>>>
> >>>> Sent from the cxf-user mailing list archive at Nabble.com.
> >>>>
> >>>
> >>
> >>
> >> --
> >> Sergey Beryozkin
> >>
> >> Talend Community Coders
> >> http://coders.talend.com/
> >>
> >> Blog: http://sberyozkin.blogspot.com
> >>
> >>
> >> ------------------------------
> >>   If you reply to this email, your message will be added to the
> discussion
> >> below:
> >>
> >>
> http://cxf.547215.n5.nabble.com/WADL-Grammar-section-lost-for-generic-service-class-tp5755870p5756525.html
> >>   To unsubscribe from WADL Grammar section lost for generic service
> class., click
> >> here
> >> <
> >> .
> >> NAML
> >> <
> http://cxf.547215.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>
> >>
> >
> >
> >
> >
> > --
> > View this message in context:
> http://cxf.547215.n5.nabble.com/WADL-Grammar-section-lost-for-generic-service-class-tp5755870p5756544.html
> > Sent from the cxf-user mailing list archive at Nabble.com.
> >
>
>
>
> ------------------------------
>  If you reply to this email, your message will be added to the discussion
> below:
>
> http://cxf.547215.n5.nabble.com/WADL-Grammar-section-lost-for-generic-service-class-tp5755870p5756546.html
>  To unsubscribe from WADL Grammar section lost for generic service class., click
> here
> <http://cxf.547215.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5755870&code=bmFtZGV0c0BnbWFpbC5jb218NTc1NTg3MHwxNzc3NjA4OTEz>
> .
> NAML
> <http://cxf.547215.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>




--
View this message in context: http://cxf.547215.n5.nabble.com/WADL-Grammar-section-lost-for-generic-service-class-tp5755870p5756607.html
Sent from the cxf-user mailing list archive at Nabble.com.

Mime
View raw message