You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by David Karlsen <da...@gmail.com> on 2013/10/07 11:54:24 UTC

Getting proper wadl generated

Hi.

I have an existing jax-ws service that I now additionally want to expose as
a REST/jax-rs service.
I've configured it like this: *http://pastebin.com/h7cy8ZYB *
The wadl generated looks like: *http://pastebin.com/QQRbNb3n *
I would expect it to refer to the request /response types not to look like
<representation mediaType="application/xml"/>

but rather something like:
<representation mediaType="application/xml"
type="tns:customerCreateRequest" />

I've tried adding @XmlName etc but nothing changes.

Any hints?

--
David J. M. Karlsen - http://www.linkedin.com/in/davidkarlsen

Re: Getting proper wadl generated

Posted by Sergey Beryozkin <sb...@gmail.com>.
Hi David - thanks for a quick confirmation;

A bit more work may still need to be done to do with minimizing the need 
to use @XMlName when the default XmlType or explicit collection element 
name calculation is not enough - because the customization info is 
already available in a registered JAXB provider - we'll deal with it a 
bit later on, @XMLName is there if needed for now

Cheers. Sergey

On 17/10/13 18:52, David Karlsen wrote:
> OK - I did a build of 2.7.x-fixes myself.
> It works! Excellent work!
>
>
> 2013/10/17 Sergey Beryozkin <sberyozkin@gmail.com
> <ma...@gmail.com>>
>
>     Not yet, I committed an hour ago
>
>     Cheers, Sergey
>
>     On 17/10/13 17:34, David Karlsen wrote:
>
>         That is great news. Is a snapshot version available?
>
>         17. okt. 2013 17:42 skrev "Sergey Beryozkin"
>         <sberyozkin@gmail.com <ma...@gmail.com>
>         <mailto:sberyozkin@gmail.com <ma...@gmail.com>>>
>         følgende:
>
>
>              I've committed some changes to 2.7.x:
>
>              - XmlType only annotated classes should now be processed as
>         expected,
>              the schema elements will be added in addition to what JAXB
>         compiler
>              generates, and the references from WADL reps to these elements
>              should be visible
>              - @XMLName is not needed unless default XmlType processing
>         needs to
>              be customized
>
>              - added a WadlGenerator constructor accepting a Bus - this
>         should
>              help with loading the external resources not visible to the
>         default
>              loader/resolver, in case you'd like to reuse the existing
>         schema
>              resources
>
>              Give it a try please when you get a chance,
>              Sergey
>
>              On 10/10/13 15:20, David Karlsen wrote:
>
>                  No - I had it like this:
>                     <bean
>         class="org.apache.cxf.jaxrs.____model.wadl.WadlGenerator">
>
>                                                    <property
>                  name="useJaxbContextForQnames" value="true" />
>                                                    <property
>                  name="addResourceAndMethodIds" value="true" />
>                                            </bean>
>
>                  I've tried to:
>                  <bean
>         class="org.apache.cxf.jaxrs.____model.wadl.WadlGenerator">
>
>                  <property name="useJaxbContextForQnames" value="true" />
>                  <property name="addResourceAndMethodIds" value="true" />
>                  <property name="schemaLocations">
>                  <list>
>                  <value>/xsd/common-v1.xsd</____value>
>
>                  ........ additional schemas....
>                  </list>
>                  </property>
>                  </bean>
>
>                  also xsd/common-v1.xsd
>                  or
>                  classpath:xsd/common-v1.xsd
>
>                  none of them are able to find the schema:
>                  2013-10-10 16:00:26,113 [main][][][][][][][] WARN
>                  org.apache.cxf.jaxrs.model.____wadl.WadlGenerator - No
>         schema resource
>
>                  /xsd/common-v1.xsd can be loaded : null
>
>
>                  the schemas are in another jarfile on the classpath -
>         so not in
>                  the .war
>                  which contains cxf-servlet.xml which contains the above
>                  wadlgenerator config
>
>
>                  2013/10/10 Sergey Beryozkin <sberyozkin@gmail.com
>         <ma...@gmail.com>
>                  <mailto:sberyozkin@gmail.com <ma...@gmail.com>>
>                  <mailto:sberyozkin@gmail.com
>         <ma...@gmail.com> <mailto:sberyozkin@gmail.com
>         <ma...@gmail.com>>>__>
>
>
>                       Hi David
>
>                       I'm doing some work on it, following our
>         conversation on IRC.
>                       Let me double check one thing, do you configure
>                  WADLGenerator with
>                       the list of schemas to be included in the grammar
>         section ?
>
>                       If not then WADLGenerator may have to create
>         xsd:elements
>                  somehow
>                       itself, similarly to the way it does it for explicit
>                  collections
>                       like List<Book>, because JAXB won't generate itself
>                  xsd:element from
>                       @XmlType only
>
>                       Cheers. Sergey
>
>
>                       On 08/10/13 09:34, David Karlsen wrote:
>
>                           OK - been experimenting a little - it's due to
>         missing
>                           XmlRootElement
>                           annotations.
>
>                           If I "inline" the type definition it will work.
>                           This works:
>                           <element name="customerCreateRequest">
>                           <complexType>
>                           <annotation>
>                           <documentation>
>                           Create a new distinct customer.
>                           Customers have distinct customerIds within an
>         organization.
>                           </documentation>
>                           </annotation>
>                           <sequence>
>                           <element name="customer"
>         type="customer:customerType" />
>                           </sequence>
>                           </complexType>
>                           </element>
>
>                           instead of the more reusable (will not work):
>                           <element name="customerCreateRequest"
>                           type="tns:______customerCreateRequest">
>
>
>
>                           <complexType name="customerCreateRequest">
>                           <annotation>
>                           <documentation>
>                           Create a new distinct customer.
>                           Customers have distinct customerIds within an
>         organization.
>                           </documentation>
>                           </annotation>
>                           <sequence>
>                           <element name="customer"
>         type="customer:customerType" />
>                           </sequence>
>                           </complexType>
>
>
>                           Is there no way around this?
>
>                           I thought that was what @XmlName was for.
>
>
>
>                           2013/10/7 David Karlsen
>         <davidkarlsen@gmail.com <ma...@gmail.com>
>                  <mailto:davidkarlsen@gmail.com
>         <ma...@gmail.com>__>
>                           <mailto:davidkarlsen@gmail.com
>         <ma...@gmail.com>
>                  <mailto:davidkarlsen@gmail.com
>         <ma...@gmail.com>__>__>>
>
>                               Hi.
>
>                               I did this:
>                               @POST
>                                     @Consumes( {
>         MediaType.APPLICATION_XML} )
>                                     @Produces( {
>         MediaType.APPLICATION_XML } )
>                                     public void testCreate( @XMLName(
>         value =
>
>
>         "{urn:srv.jfr.tac.fs.edb.com:w______s:customer:v1}______customerCreateRequest"
>
>                               ) CustomerCreateRequest
>         customerCreateRequest ) {
>
>                               And have also cleaned up the config.
>
>
>                               2013/10/7 Sergey Beryozkin
>         <sberyozkin@gmail.com <ma...@gmail.com>
>                  <mailto:sberyozkin@gmail.com <ma...@gmail.com>>
>                               <mailto:sberyozkin@gmail.com
>         <ma...@gmail.com>
>
>                  <mailto:sberyozkin@gmail.com
>         <ma...@gmail.com>>>__>
>
>                                   Hi David
>
>                                   On 07/10/13 10:54, David Karlsen wrote:
>
>                                       Hi.
>
>                                       I have an existing jax-ws service
>         that I now
>                                       additionally want to expose
>                                       as
>                                       a REST/jax-rs service.
>                                       I've configured it like this:
>                                       *http://pastebin.com/h7cy8ZYB *
>                                       The wadl generated looks like:
>                                       *http://pastebin.com/QQRbNb3n *
>
>                                       I would expect it to refer to the
>         request
>                  /response
>                                       types not to look
>                                       like
>                                       <representation
>         mediaType="application/xml"/>
>
>                                       but rather something like:
>                                       <representation
>         mediaType="application/xml"
>
>           type="tns:**______customerCreateRequest" />
>
>
>
>                                       I've tried adding @XmlName etc but
>         nothing
>                  changes.
>
>
>                                   I suspect the reason you don't have
>         the proper
>                  mappings
>                                   generated is that
>                                   the JAX-WS generated code has the bean
>                  parameters with
>                                   JAXB XMLType only
>                                   and the JAX-RS runtime does
>         wrap/unwrap the types.
>
>                                   How do you use XMLName ? It needs to
>         contain
>                  extended
>                                   QNames, example "{
>         http://myns <http://myns/>}MyRootElement".
>
>                                   As a side note, the configuration can be
>                  simplified:
>                                   - two conflicting JAXB providers, need
>         to drop
>                  either
>                                   jaxrs:dataBinding
>                                   or JAXBProvider,
>                                   - two Jackson providers, I'm not sure
>         which one
>                  will
>                                   work better in your
>                                   case, please try
>                                   - re the schema validation, you need
>         to get
>                  that schema
>                                   list set up only
>                                   once, using SchemaHandler makes sense
>         only if
>                  you reuse
>                                   it between CXF JAXB
>                                   and JSON providers, but you don't, so
>         drop it;
>                  next , if
>                                   you decide to keep
>                                   JAXBProvider then drop
>         jaxrs:schemaLocations
>
>                                   Cheers, Sergey
>
>
>
>
>
>                                       Any hints?
>
>                                       --
>                                       David J. M. Karlsen -
>         http://www.linkedin.com/in/**______davidkarlsen
>         <http://www.linkedin.com/in/**____davidkarlsen>
>                  <http://www.linkedin.com/in/**____davidkarlsen
>         <http://www.linkedin.com/in/**__davidkarlsen>>
>
>                  <http://www.linkedin.com/in/**____davidkarlsen
>         <http://www.linkedin.com/in/**__davidkarlsen>
>                  <http://www.linkedin.com/in/**__davidkarlsen
>         <http://www.linkedin.com/in/**davidkarlsen>>><http://www.
>         <http://www./>__li__n__kedin.com/in/davidkarlsen
>         <http://lin__kedin.com/in/davidkarlsen>
>                  <http://linkedin.com/in/__davidkarlsen
>         <http://linkedin.com/in/davidkarlsen>>
>
>
>           <http://www.linkedin.com/in/____davidkarlsen
>         <http://www.linkedin.com/in/__davidkarlsen>
>                  <http://www.linkedin.com/in/__davidkarlsen
>         <http://www.linkedin.com/in/davidkarlsen>>>>
>
>
>
>
>
>                               --
>                               --
>                               David J. M. Karlsen -
>         http://www.linkedin.com/in/______davidkarlsen
>         <http://www.linkedin.com/in/____davidkarlsen>
>                  <http://www.linkedin.com/in/____davidkarlsen
>         <http://www.linkedin.com/in/__davidkarlsen>>
>
>
>           <http://www.linkedin.com/in/____davidkarlsen
>         <http://www.linkedin.com/in/__davidkarlsen>
>                  <http://www.linkedin.com/in/__davidkarlsen
>         <http://www.linkedin.com/in/davidkarlsen>>>
>
>
>
>
>
>
>                       --
>                       Sergey Beryozkin
>
>                       Talend Community Coders
>         http://coders.talend.com/
>
>                       Blog: http://sberyozkin.blogspot.com
>         <http://sberyozkin.blogspot.com/>
>
>
>
>
>                  --
>                  --
>                  David J. M. Karlsen -
>         http://www.linkedin.com/in/____davidkarlsen
>         <http://www.linkedin.com/in/__davidkarlsen>
>
>                  <http://www.linkedin.com/in/__davidkarlsen
>         <http://www.linkedin.com/in/davidkarlsen>>
>
>
>
>              --
>              Sergey Beryozkin
>
>              Talend Community Coders
>         http://coders.talend.com/
>
>              Blog: http://sberyozkin.blogspot.com
>         <http://sberyozkin.blogspot.com/>
>
>
>
>
>
> --
> --
> David J. M. Karlsen - http://www.linkedin.com/in/davidkarlsen


Re: Getting proper wadl generated

Posted by David Karlsen <da...@gmail.com>.
OK - I did a build of 2.7.x-fixes myself.
It works! Excellent work!


2013/10/17 Sergey Beryozkin <sb...@gmail.com>

> Not yet, I committed an hour ago
>
> Cheers, Sergey
>
> On 17/10/13 17:34, David Karlsen wrote:
>
>> That is great news. Is a snapshot version available?
>>
>> 17. okt. 2013 17:42 skrev "Sergey Beryozkin" <sberyozkin@gmail.com
>> <ma...@gmail.com>> følgende:
>>
>>
>>     I've committed some changes to 2.7.x:
>>
>>     - XmlType only annotated classes should now be processed as expected,
>>     the schema elements will be added in addition to what JAXB compiler
>>     generates, and the references from WADL reps to these elements
>>     should be visible
>>     - @XMLName is not needed unless default XmlType processing needs to
>>     be customized
>>
>>     - added a WadlGenerator constructor accepting a Bus - this should
>>     help with loading the external resources not visible to the default
>>     loader/resolver, in case you'd like to reuse the existing schema
>>     resources
>>
>>     Give it a try please when you get a chance,
>>     Sergey
>>
>>     On 10/10/13 15:20, David Karlsen wrote:
>>
>>         No - I had it like this:
>>            <bean class="org.apache.cxf.jaxrs.__**
>> model.wadl.WadlGenerator">
>>
>>                                           <property
>>         name="useJaxbContextForQnames" value="true" />
>>                                           <property
>>         name="addResourceAndMethodIds" value="true" />
>>                                   </bean>
>>
>>         I've tried to:
>>         <bean class="org.apache.cxf.jaxrs.__**model.wadl.WadlGenerator">
>>
>>         <property name="useJaxbContextForQnames" value="true" />
>>         <property name="addResourceAndMethodIds" value="true" />
>>         <property name="schemaLocations">
>>         <list>
>>         <value>/xsd/common-v1.xsd</__**value>
>>
>>         ........ additional schemas....
>>         </list>
>>         </property>
>>         </bean>
>>
>>         also xsd/common-v1.xsd
>>         or
>>         classpath:xsd/common-v1.xsd
>>
>>         none of them are able to find the schema:
>>         2013-10-10 16:00:26,113 [main][][][][][][][] WARN
>>         org.apache.cxf.jaxrs.model.__**wadl.WadlGenerator - No schema
>> resource
>>
>>         /xsd/common-v1.xsd can be loaded : null
>>
>>
>>         the schemas are in another jarfile on the classpath - so not in
>>         the .war
>>         which contains cxf-servlet.xml which contains the above
>>         wadlgenerator config
>>
>>
>>         2013/10/10 Sergey Beryozkin <sberyozkin@gmail.com
>>         <ma...@gmail.com>
>>         <mailto:sberyozkin@gmail.com <ma...@gmail.com>>**>
>>
>>
>>              Hi David
>>
>>              I'm doing some work on it, following our conversation on IRC.
>>              Let me double check one thing, do you configure
>>         WADLGenerator with
>>              the list of schemas to be included in the grammar section ?
>>
>>              If not then WADLGenerator may have to create xsd:elements
>>         somehow
>>              itself, similarly to the way it does it for explicit
>>         collections
>>              like List<Book>, because JAXB won't generate itself
>>         xsd:element from
>>              @XmlType only
>>
>>              Cheers. Sergey
>>
>>
>>              On 08/10/13 09:34, David Karlsen wrote:
>>
>>                  OK - been experimenting a little - it's due to missing
>>                  XmlRootElement
>>                  annotations.
>>
>>                  If I "inline" the type definition it will work.
>>                  This works:
>>                  <element name="customerCreateRequest">
>>                  <complexType>
>>                  <annotation>
>>                  <documentation>
>>                  Create a new distinct customer.
>>                  Customers have distinct customerIds within an
>> organization.
>>                  </documentation>
>>                  </annotation>
>>                  <sequence>
>>                  <element name="customer" type="customer:customerType" />
>>                  </sequence>
>>                  </complexType>
>>                  </element>
>>
>>                  instead of the more reusable (will not work):
>>                  <element name="customerCreateRequest"
>>                  type="tns:____**customerCreateRequest">
>>
>>
>>
>>                  <complexType name="customerCreateRequest">
>>                  <annotation>
>>                  <documentation>
>>                  Create a new distinct customer.
>>                  Customers have distinct customerIds within an
>> organization.
>>                  </documentation>
>>                  </annotation>
>>                  <sequence>
>>                  <element name="customer" type="customer:customerType" />
>>                  </sequence>
>>                  </complexType>
>>
>>
>>                  Is there no way around this?
>>
>>                  I thought that was what @XmlName was for.
>>
>>
>>
>>                  2013/10/7 David Karlsen <davidkarlsen@gmail.com
>>         <mailto:davidkarlsen@gmail.com**>
>>                  <mailto:davidkarlsen@gmail.com
>>         <mailto:davidkarlsen@gmail.com**>__>>
>>
>>                      Hi.
>>
>>                      I did this:
>>                      @POST
>>                            @Consumes( { MediaType.APPLICATION_XML} )
>>                            @Produces( { MediaType.APPLICATION_XML } )
>>                            public void testCreate( @XMLName( value =
>>
>>         "{urn:srv.jfr.tac.fs.edb.com:w**____s:customer:v1}____**
>> customerCreateRequest"
>>
>>                      ) CustomerCreateRequest customerCreateRequest ) {
>>
>>                      And have also cleaned up the config.
>>
>>
>>                      2013/10/7 Sergey Beryozkin <sberyozkin@gmail.com
>>         <ma...@gmail.com>
>>                      <mailto:sberyozkin@gmail.com
>>
>>         <ma...@gmail.com>>**>
>>
>>                          Hi David
>>
>>                          On 07/10/13 10:54, David Karlsen wrote:
>>
>>                              Hi.
>>
>>                              I have an existing jax-ws service that I now
>>                              additionally want to expose
>>                              as
>>                              a REST/jax-rs service.
>>                              I've configured it like this:
>>                              *http://pastebin.com/h7cy8ZYB *
>>                              The wadl generated looks like:
>>                              *http://pastebin.com/QQRbNb3n *
>>
>>                              I would expect it to refer to the request
>>         /response
>>                              types not to look
>>                              like
>>                              <representation mediaType="application/xml"/>
>>
>>                              but rather something like:
>>                              <representation mediaType="application/xml"
>>                              type="tns:**____**customerCreateRequest" />
>>
>>
>>
>>                              I've tried adding @XmlName etc but nothing
>>         changes.
>>
>>
>>                          I suspect the reason you don't have the proper
>>         mappings
>>                          generated is that
>>                          the JAX-WS generated code has the bean
>>         parameters with
>>                          JAXB XMLType only
>>                          and the JAX-RS runtime does wrap/unwrap the
>> types.
>>
>>                          How do you use XMLName ? It needs to contain
>>         extended
>>                          QNames, example "{
>>         http://myns}MyRootElement".
>>
>>                          As a side note, the configuration can be
>>         simplified:
>>                          - two conflicting JAXB providers, need to drop
>>         either
>>                          jaxrs:dataBinding
>>                          or JAXBProvider,
>>                          - two Jackson providers, I'm not sure which one
>>         will
>>                          work better in your
>>                          case, please try
>>                          - re the schema validation, you need to get
>>         that schema
>>                          list set up only
>>                          once, using SchemaHandler makes sense only if
>>         you reuse
>>                          it between CXF JAXB
>>                          and JSON providers, but you don't, so drop it;
>>         next , if
>>                          you decide to keep
>>                          JAXBProvider then drop jaxrs:schemaLocations
>>
>>                          Cheers, Sergey
>>
>>
>>
>>
>>
>>                              Any hints?
>>
>>                              --
>>                              David J. M. Karlsen -
>>         http://www.linkedin.com/in/**_**___davidkarlsen<http://www.linkedin.com/in/**____davidkarlsen>
>>         <http://www.linkedin.com/in/****__davidkarlsen<http://www.linkedin.com/in/**__davidkarlsen>
>> >
>>
>>         <http://www.linkedin.com/in/****__davidkarlsen<http://www.linkedin.com/in/**__davidkarlsen>
>>         <http://www.linkedin.com/in/****davidkarlsen<http://www.linkedin.com/in/**davidkarlsen>
>> >><http://www.__li**n__kedin.com/in/davidkarlsen<http://lin__kedin.com/in/davidkarlsen>
>>         <http://linkedin.com/in/**davidkarlsen<http://linkedin.com/in/davidkarlsen>
>> >
>>
>>                              <http://www.linkedin.com/in/__**davidkarlsen<http://www.linkedin.com/in/__davidkarlsen>
>>         <http://www.linkedin.com/in/**davidkarlsen<http://www.linkedin.com/in/davidkarlsen>
>> >>>
>>
>>
>>
>>
>>
>>                      --
>>                      --
>>                      David J. M. Karlsen -
>>         http://www.linkedin.com/in/___**_davidkarlsen<http://www.linkedin.com/in/____davidkarlsen>
>>         <http://www.linkedin.com/in/__**davidkarlsen<http://www.linkedin.com/in/__davidkarlsen>
>> >
>>
>>                      <http://www.linkedin.com/in/__**davidkarlsen<http://www.linkedin.com/in/__davidkarlsen>
>>         <http://www.linkedin.com/in/**davidkarlsen<http://www.linkedin.com/in/davidkarlsen>
>> >>
>>
>>
>>
>>
>>
>>
>>              --
>>              Sergey Beryozkin
>>
>>              Talend Community Coders
>>         http://coders.talend.com/
>>
>>              Blog: http://sberyozkin.blogspot.com
>>
>>
>>
>>
>>         --
>>         --
>>         David J. M. Karlsen - http://www.linkedin.com/in/__**davidkarlsen<http://www.linkedin.com/in/__davidkarlsen>
>>
>>         <http://www.linkedin.com/in/**davidkarlsen<http://www.linkedin.com/in/davidkarlsen>
>> >
>>
>>
>>
>>     --
>>     Sergey Beryozkin
>>
>>     Talend Community Coders
>>     http://coders.talend.com/
>>
>>     Blog: http://sberyozkin.blogspot.com
>>
>>
>


-- 
--
David J. M. Karlsen - http://www.linkedin.com/in/davidkarlsen

Re: Getting proper wadl generated

Posted by Sergey Beryozkin <sb...@gmail.com>.
Not yet, I committed an hour ago

Cheers, Sergey
On 17/10/13 17:34, David Karlsen wrote:
> That is great news. Is a snapshot version available?
>
> 17. okt. 2013 17:42 skrev "Sergey Beryozkin" <sberyozkin@gmail.com
> <ma...@gmail.com>> følgende:
>
>     I've committed some changes to 2.7.x:
>
>     - XmlType only annotated classes should now be processed as expected,
>     the schema elements will be added in addition to what JAXB compiler
>     generates, and the references from WADL reps to these elements
>     should be visible
>     - @XMLName is not needed unless default XmlType processing needs to
>     be customized
>
>     - added a WadlGenerator constructor accepting a Bus - this should
>     help with loading the external resources not visible to the default
>     loader/resolver, in case you'd like to reuse the existing schema
>     resources
>
>     Give it a try please when you get a chance,
>     Sergey
>
>     On 10/10/13 15:20, David Karlsen wrote:
>
>         No - I had it like this:
>            <bean class="org.apache.cxf.jaxrs.__model.wadl.WadlGenerator">
>                                           <property
>         name="useJaxbContextForQnames" value="true" />
>                                           <property
>         name="addResourceAndMethodIds" value="true" />
>                                   </bean>
>
>         I've tried to:
>         <bean class="org.apache.cxf.jaxrs.__model.wadl.WadlGenerator">
>         <property name="useJaxbContextForQnames" value="true" />
>         <property name="addResourceAndMethodIds" value="true" />
>         <property name="schemaLocations">
>         <list>
>         <value>/xsd/common-v1.xsd</__value>
>         ........ additional schemas....
>         </list>
>         </property>
>         </bean>
>
>         also xsd/common-v1.xsd
>         or
>         classpath:xsd/common-v1.xsd
>
>         none of them are able to find the schema:
>         2013-10-10 16:00:26,113 [main][][][][][][][] WARN
>         org.apache.cxf.jaxrs.model.__wadl.WadlGenerator - No schema resource
>         /xsd/common-v1.xsd can be loaded : null
>
>
>         the schemas are in another jarfile on the classpath - so not in
>         the .war
>         which contains cxf-servlet.xml which contains the above
>         wadlgenerator config
>
>
>         2013/10/10 Sergey Beryozkin <sberyozkin@gmail.com
>         <ma...@gmail.com>
>         <mailto:sberyozkin@gmail.com <ma...@gmail.com>>>
>
>              Hi David
>
>              I'm doing some work on it, following our conversation on IRC.
>              Let me double check one thing, do you configure
>         WADLGenerator with
>              the list of schemas to be included in the grammar section ?
>
>              If not then WADLGenerator may have to create xsd:elements
>         somehow
>              itself, similarly to the way it does it for explicit
>         collections
>              like List<Book>, because JAXB won't generate itself
>         xsd:element from
>              @XmlType only
>
>              Cheers. Sergey
>
>
>              On 08/10/13 09:34, David Karlsen wrote:
>
>                  OK - been experimenting a little - it's due to missing
>                  XmlRootElement
>                  annotations.
>
>                  If I "inline" the type definition it will work.
>                  This works:
>                  <element name="customerCreateRequest">
>                  <complexType>
>                  <annotation>
>                  <documentation>
>                  Create a new distinct customer.
>                  Customers have distinct customerIds within an organization.
>                  </documentation>
>                  </annotation>
>                  <sequence>
>                  <element name="customer" type="customer:customerType" />
>                  </sequence>
>                  </complexType>
>                  </element>
>
>                  instead of the more reusable (will not work):
>                  <element name="customerCreateRequest"
>                  type="tns:____customerCreateRequest">
>
>
>                  <complexType name="customerCreateRequest">
>                  <annotation>
>                  <documentation>
>                  Create a new distinct customer.
>                  Customers have distinct customerIds within an organization.
>                  </documentation>
>                  </annotation>
>                  <sequence>
>                  <element name="customer" type="customer:customerType" />
>                  </sequence>
>                  </complexType>
>
>
>                  Is there no way around this?
>
>                  I thought that was what @XmlName was for.
>
>
>
>                  2013/10/7 David Karlsen <davidkarlsen@gmail.com
>         <ma...@gmail.com>
>                  <mailto:davidkarlsen@gmail.com
>         <ma...@gmail.com>__>>
>
>                      Hi.
>
>                      I did this:
>                      @POST
>                            @Consumes( { MediaType.APPLICATION_XML} )
>                            @Produces( { MediaType.APPLICATION_XML } )
>                            public void testCreate( @XMLName( value =
>
>         "{urn:srv.jfr.tac.fs.edb.com:w____s:customer:v1}____customerCreateRequest"
>                      ) CustomerCreateRequest customerCreateRequest ) {
>
>                      And have also cleaned up the config.
>
>
>                      2013/10/7 Sergey Beryozkin <sberyozkin@gmail.com
>         <ma...@gmail.com>
>                      <mailto:sberyozkin@gmail.com
>         <ma...@gmail.com>>>
>
>                          Hi David
>
>                          On 07/10/13 10:54, David Karlsen wrote:
>
>                              Hi.
>
>                              I have an existing jax-ws service that I now
>                              additionally want to expose
>                              as
>                              a REST/jax-rs service.
>                              I've configured it like this:
>                              *http://pastebin.com/h7cy8ZYB *
>                              The wadl generated looks like:
>                              *http://pastebin.com/QQRbNb3n *
>
>                              I would expect it to refer to the request
>         /response
>                              types not to look
>                              like
>                              <representation mediaType="application/xml"/>
>
>                              but rather something like:
>                              <representation mediaType="application/xml"
>                              type="tns:**____customerCreateRequest" />
>
>
>                              I've tried adding @XmlName etc but nothing
>         changes.
>
>
>                          I suspect the reason you don't have the proper
>         mappings
>                          generated is that
>                          the JAX-WS generated code has the bean
>         parameters with
>                          JAXB XMLType only
>                          and the JAX-RS runtime does wrap/unwrap the types.
>
>                          How do you use XMLName ? It needs to contain
>         extended
>                          QNames, example "{
>         http://myns}MyRootElement".
>
>                          As a side note, the configuration can be
>         simplified:
>                          - two conflicting JAXB providers, need to drop
>         either
>                          jaxrs:dataBinding
>                          or JAXBProvider,
>                          - two Jackson providers, I'm not sure which one
>         will
>                          work better in your
>                          case, please try
>                          - re the schema validation, you need to get
>         that schema
>                          list set up only
>                          once, using SchemaHandler makes sense only if
>         you reuse
>                          it between CXF JAXB
>                          and JSON providers, but you don't, so drop it;
>         next , if
>                          you decide to keep
>                          JAXBProvider then drop jaxrs:schemaLocations
>
>                          Cheers, Sergey
>
>
>
>
>
>                              Any hints?
>
>                              --
>                              David J. M. Karlsen -
>         http://www.linkedin.com/in/**____davidkarlsen
>         <http://www.linkedin.com/in/**__davidkarlsen>
>
>         <http://www.linkedin.com/in/**__davidkarlsen
>         <http://www.linkedin.com/in/**davidkarlsen>><http://www.__lin__kedin.com/in/davidkarlsen
>         <http://linkedin.com/in/davidkarlsen>
>                              <http://www.linkedin.com/in/__davidkarlsen
>         <http://www.linkedin.com/in/davidkarlsen>>>
>
>
>
>
>
>                      --
>                      --
>                      David J. M. Karlsen -
>         http://www.linkedin.com/in/____davidkarlsen
>         <http://www.linkedin.com/in/__davidkarlsen>
>                      <http://www.linkedin.com/in/__davidkarlsen
>         <http://www.linkedin.com/in/davidkarlsen>>
>
>
>
>
>
>
>              --
>              Sergey Beryozkin
>
>              Talend Community Coders
>         http://coders.talend.com/
>
>              Blog: http://sberyozkin.blogspot.com
>
>
>
>
>         --
>         --
>         David J. M. Karlsen - http://www.linkedin.com/in/__davidkarlsen
>         <http://www.linkedin.com/in/davidkarlsen>
>
>
>
>     --
>     Sergey Beryozkin
>
>     Talend Community Coders
>     http://coders.talend.com/
>
>     Blog: http://sberyozkin.blogspot.com
>


Re: Getting proper wadl generated

Posted by David Karlsen <da...@gmail.com>.
That is great news. Is a snapshot version available?
17. okt. 2013 17:42 skrev "Sergey Beryozkin" <sb...@gmail.com>
følgende:

> I've committed some changes to 2.7.x:
>
> - XmlType only annotated classes should now be processed as expected,
> the schema elements will be added in addition to what JAXB compiler
> generates, and the references from WADL reps to these elements should be
> visible
> - @XMLName is not needed unless default XmlType processing needs to be
> customized
>
> - added a WadlGenerator constructor accepting a Bus - this should help
> with loading the external resources not visible to the default
> loader/resolver, in case you'd like to reuse the existing schema resources
>
> Give it a try please when you get a chance,
> Sergey
>
> On 10/10/13 15:20, David Karlsen wrote:
>
>> No - I had it like this:
>>   <bean class="org.apache.cxf.jaxrs.**model.wadl.WadlGenerator">
>>                                  <property
>> name="useJaxbContextForQnames" value="true" />
>>                                  <property
>> name="addResourceAndMethodIds" value="true" />
>>                          </bean>
>>
>> I've tried to:
>> <bean class="org.apache.cxf.jaxrs.**model.wadl.WadlGenerator">
>> <property name="useJaxbContextForQnames" value="true" />
>> <property name="addResourceAndMethodIds" value="true" />
>> <property name="schemaLocations">
>> <list>
>> <value>/xsd/common-v1.xsd</**value>
>> ........ additional schemas....
>> </list>
>> </property>
>> </bean>
>>
>> also xsd/common-v1.xsd
>> or
>> classpath:xsd/common-v1.xsd
>>
>> none of them are able to find the schema:
>> 2013-10-10 16:00:26,113 [main][][][][][][][] WARN
>> org.apache.cxf.jaxrs.model.**wadl.WadlGenerator - No schema resource
>> /xsd/common-v1.xsd can be loaded : null
>>
>>
>> the schemas are in another jarfile on the classpath - so not in the .war
>> which contains cxf-servlet.xml which contains the above wadlgenerator
>> config
>>
>>
>> 2013/10/10 Sergey Beryozkin <sberyozkin@gmail.com
>> <ma...@gmail.com>>
>>
>>     Hi David
>>
>>     I'm doing some work on it, following our conversation on IRC.
>>     Let me double check one thing, do you configure WADLGenerator with
>>     the list of schemas to be included in the grammar section ?
>>
>>     If not then WADLGenerator may have to create xsd:elements somehow
>>     itself, similarly to the way it does it for explicit collections
>>     like List<Book>, because JAXB won't generate itself xsd:element from
>>     @XmlType only
>>
>>     Cheers. Sergey
>>
>>
>>     On 08/10/13 09:34, David Karlsen wrote:
>>
>>         OK - been experimenting a little - it's due to missing
>>         XmlRootElement
>>         annotations.
>>
>>         If I "inline" the type definition it will work.
>>         This works:
>>         <element name="customerCreateRequest">
>>         <complexType>
>>         <annotation>
>>         <documentation>
>>         Create a new distinct customer.
>>         Customers have distinct customerIds within an organization.
>>         </documentation>
>>         </annotation>
>>         <sequence>
>>         <element name="customer" type="customer:customerType" />
>>         </sequence>
>>         </complexType>
>>         </element>
>>
>>         instead of the more reusable (will not work):
>>         <element name="customerCreateRequest"
>>         type="tns:__**customerCreateRequest">
>>
>>
>>         <complexType name="customerCreateRequest">
>>         <annotation>
>>         <documentation>
>>         Create a new distinct customer.
>>         Customers have distinct customerIds within an organization.
>>         </documentation>
>>         </annotation>
>>         <sequence>
>>         <element name="customer" type="customer:customerType" />
>>         </sequence>
>>         </complexType>
>>
>>
>>         Is there no way around this?
>>
>>         I thought that was what @XmlName was for.
>>
>>
>>
>>         2013/10/7 David Karlsen <davidkarlsen@gmail.com
>>         <mailto:davidkarlsen@gmail.com**>>
>>
>>             Hi.
>>
>>             I did this:
>>             @POST
>>                   @Consumes( { MediaType.APPLICATION_XML} )
>>                   @Produces( { MediaType.APPLICATION_XML } )
>>                   public void testCreate( @XMLName( value =
>>             "{urn:srv.jfr.tac.fs.edb.com:w**__s:customer:v1}__**
>> customerCreateRequest"
>>             ) CustomerCreateRequest customerCreateRequest ) {
>>
>>             And have also cleaned up the config.
>>
>>
>>             2013/10/7 Sergey Beryozkin <sberyozkin@gmail.com
>>             <ma...@gmail.com>>
>>
>>                 Hi David
>>
>>                 On 07/10/13 10:54, David Karlsen wrote:
>>
>>                     Hi.
>>
>>                     I have an existing jax-ws service that I now
>>                     additionally want to expose
>>                     as
>>                     a REST/jax-rs service.
>>                     I've configured it like this:
>>                     *http://pastebin.com/h7cy8ZYB *
>>                     The wadl generated looks like:
>>                     *http://pastebin.com/QQRbNb3n *
>>
>>                     I would expect it to refer to the request /response
>>                     types not to look
>>                     like
>>                     <representation mediaType="application/xml"/>
>>
>>                     but rather something like:
>>                     <representation mediaType="application/xml"
>>                     type="tns:**__**customerCreateRequest" />
>>
>>
>>                     I've tried adding @XmlName etc but nothing changes.
>>
>>
>>                 I suspect the reason you don't have the proper mappings
>>                 generated is that
>>                 the JAX-WS generated code has the bean parameters with
>>                 JAXB XMLType only
>>                 and the JAX-RS runtime does wrap/unwrap the types.
>>
>>                 How do you use XMLName ? It needs to contain extended
>>                 QNames, example "{
>>                 http://myns}MyRootElement".
>>
>>                 As a side note, the configuration can be simplified:
>>                 - two conflicting JAXB providers, need to drop either
>>                 jaxrs:dataBinding
>>                 or JAXBProvider,
>>                 - two Jackson providers, I'm not sure which one will
>>                 work better in your
>>                 case, please try
>>                 - re the schema validation, you need to get that schema
>>                 list set up only
>>                 once, using SchemaHandler makes sense only if you reuse
>>                 it between CXF JAXB
>>                 and JSON providers, but you don't, so drop it; next , if
>>                 you decide to keep
>>                 JAXBProvider then drop jaxrs:schemaLocations
>>
>>                 Cheers, Sergey
>>
>>
>>
>>
>>
>>                     Any hints?
>>
>>                     --
>>                     David J. M. Karlsen -
>>                     http://www.linkedin.com/in/**_**_davidkarlsen<http://www.linkedin.com/in/**__davidkarlsen>
>>                     <http://www.linkedin.com/in/****davidkarlsen<http://www.linkedin.com/in/**davidkarlsen>
>> ><http://www.__lin**kedin.com/in/davidkarlsen<http://linkedin.com/in/davidkarlsen>
>>                     <http://www.linkedin.com/in/**davidkarlsen<http://www.linkedin.com/in/davidkarlsen>
>> >>
>>
>>
>>
>>
>>
>>             --
>>             --
>>             David J. M. Karlsen -
>>             http://www.linkedin.com/in/__**davidkarlsen<http://www.linkedin.com/in/__davidkarlsen>
>>             <http://www.linkedin.com/in/**davidkarlsen<http://www.linkedin.com/in/davidkarlsen>
>> >
>>
>>
>>
>>
>>
>>
>>     --
>>     Sergey Beryozkin
>>
>>     Talend Community Coders
>>     http://coders.talend.com/
>>
>>     Blog: http://sberyozkin.blogspot.com
>>
>>
>>
>>
>> --
>> --
>> David J. M. Karlsen - http://www.linkedin.com/in/**davidkarlsen<http://www.linkedin.com/in/davidkarlsen>
>>
>
>
> --
> Sergey Beryozkin
>
> Talend Community Coders
> http://coders.talend.com/
>
> Blog: http://sberyozkin.blogspot.com
>

Re: Getting proper wadl generated

Posted by Sergey Beryozkin <sb...@gmail.com>.
I've committed some changes to 2.7.x:

- XmlType only annotated classes should now be processed as expected,
the schema elements will be added in addition to what JAXB compiler 
generates, and the references from WADL reps to these elements should be 
visible
- @XMLName is not needed unless default XmlType processing needs to be 
customized

- added a WadlGenerator constructor accepting a Bus - this should help 
with loading the external resources not visible to the default 
loader/resolver, in case you'd like to reuse the existing schema resources

Give it a try please when you get a chance,
Sergey

On 10/10/13 15:20, David Karlsen wrote:
> No - I had it like this:
>   <bean class="org.apache.cxf.jaxrs.model.wadl.WadlGenerator">
>                                  <property
> name="useJaxbContextForQnames" value="true" />
>                                  <property
> name="addResourceAndMethodIds" value="true" />
>                          </bean>
>
> I've tried to:
> <bean class="org.apache.cxf.jaxrs.model.wadl.WadlGenerator">
> <property name="useJaxbContextForQnames" value="true" />
> <property name="addResourceAndMethodIds" value="true" />
> <property name="schemaLocations">
> <list>
> <value>/xsd/common-v1.xsd</value>
> ........ additional schemas....
> </list>
> </property>
> </bean>
>
> also xsd/common-v1.xsd
> or
> classpath:xsd/common-v1.xsd
>
> none of them are able to find the schema:
> 2013-10-10 16:00:26,113 [main][][][][][][][] WARN
> org.apache.cxf.jaxrs.model.wadl.WadlGenerator - No schema resource
> /xsd/common-v1.xsd can be loaded : null
>
>
> the schemas are in another jarfile on the classpath - so not in the .war
> which contains cxf-servlet.xml which contains the above wadlgenerator config
>
>
> 2013/10/10 Sergey Beryozkin <sberyozkin@gmail.com
> <ma...@gmail.com>>
>
>     Hi David
>
>     I'm doing some work on it, following our conversation on IRC.
>     Let me double check one thing, do you configure WADLGenerator with
>     the list of schemas to be included in the grammar section ?
>
>     If not then WADLGenerator may have to create xsd:elements somehow
>     itself, similarly to the way it does it for explicit collections
>     like List<Book>, because JAXB won't generate itself xsd:element from
>     @XmlType only
>
>     Cheers. Sergey
>
>
>     On 08/10/13 09:34, David Karlsen wrote:
>
>         OK - been experimenting a little - it's due to missing
>         XmlRootElement
>         annotations.
>
>         If I "inline" the type definition it will work.
>         This works:
>         <element name="customerCreateRequest">
>         <complexType>
>         <annotation>
>         <documentation>
>         Create a new distinct customer.
>         Customers have distinct customerIds within an organization.
>         </documentation>
>         </annotation>
>         <sequence>
>         <element name="customer" type="customer:customerType" />
>         </sequence>
>         </complexType>
>         </element>
>
>         instead of the more reusable (will not work):
>         <element name="customerCreateRequest"
>         type="tns:__customerCreateRequest">
>
>
>         <complexType name="customerCreateRequest">
>         <annotation>
>         <documentation>
>         Create a new distinct customer.
>         Customers have distinct customerIds within an organization.
>         </documentation>
>         </annotation>
>         <sequence>
>         <element name="customer" type="customer:customerType" />
>         </sequence>
>         </complexType>
>
>
>         Is there no way around this?
>
>         I thought that was what @XmlName was for.
>
>
>
>         2013/10/7 David Karlsen <davidkarlsen@gmail.com
>         <ma...@gmail.com>>
>
>             Hi.
>
>             I did this:
>             @POST
>                   @Consumes( { MediaType.APPLICATION_XML} )
>                   @Produces( { MediaType.APPLICATION_XML } )
>                   public void testCreate( @XMLName( value =
>             "{urn:srv.jfr.tac.fs.edb.com:w__s:customer:v1}__customerCreateRequest"
>             ) CustomerCreateRequest customerCreateRequest ) {
>
>             And have also cleaned up the config.
>
>
>             2013/10/7 Sergey Beryozkin <sberyozkin@gmail.com
>             <ma...@gmail.com>>
>
>                 Hi David
>
>                 On 07/10/13 10:54, David Karlsen wrote:
>
>                     Hi.
>
>                     I have an existing jax-ws service that I now
>                     additionally want to expose
>                     as
>                     a REST/jax-rs service.
>                     I've configured it like this:
>                     *http://pastebin.com/h7cy8ZYB *
>                     The wadl generated looks like:
>                     *http://pastebin.com/QQRbNb3n *
>
>                     I would expect it to refer to the request /response
>                     types not to look
>                     like
>                     <representation mediaType="application/xml"/>
>
>                     but rather something like:
>                     <representation mediaType="application/xml"
>                     type="tns:**__customerCreateRequest" />
>
>
>                     I've tried adding @XmlName etc but nothing changes.
>
>
>                 I suspect the reason you don't have the proper mappings
>                 generated is that
>                 the JAX-WS generated code has the bean parameters with
>                 JAXB XMLType only
>                 and the JAX-RS runtime does wrap/unwrap the types.
>
>                 How do you use XMLName ? It needs to contain extended
>                 QNames, example "{
>                 http://myns}MyRootElement".
>
>                 As a side note, the configuration can be simplified:
>                 - two conflicting JAXB providers, need to drop either
>                 jaxrs:dataBinding
>                 or JAXBProvider,
>                 - two Jackson providers, I'm not sure which one will
>                 work better in your
>                 case, please try
>                 - re the schema validation, you need to get that schema
>                 list set up only
>                 once, using SchemaHandler makes sense only if you reuse
>                 it between CXF JAXB
>                 and JSON providers, but you don't, so drop it; next , if
>                 you decide to keep
>                 JAXBProvider then drop jaxrs:schemaLocations
>
>                 Cheers, Sergey
>
>
>
>
>
>                     Any hints?
>
>                     --
>                     David J. M. Karlsen -
>                     http://www.linkedin.com/in/**__davidkarlsen
>                     <http://www.linkedin.com/in/**davidkarlsen><http://www.__linkedin.com/in/davidkarlsen
>                     <http://www.linkedin.com/in/davidkarlsen>>
>
>
>
>
>
>             --
>             --
>             David J. M. Karlsen -
>             http://www.linkedin.com/in/__davidkarlsen
>             <http://www.linkedin.com/in/davidkarlsen>
>
>
>
>
>
>
>     --
>     Sergey Beryozkin
>
>     Talend Community Coders
>     http://coders.talend.com/
>
>     Blog: http://sberyozkin.blogspot.com
>
>
>
>
> --
> --
> David J. M. Karlsen - http://www.linkedin.com/in/davidkarlsen


-- 
Sergey Beryozkin

Talend Community Coders
http://coders.talend.com/

Blog: http://sberyozkin.blogspot.com

Re: Getting proper wadl generated

Posted by Sergey Beryozkin <sb...@gmail.com>.
On 10/10/13 15:20, David Karlsen wrote:
> No - I had it like this:
>   <bean class="org.apache.cxf.jaxrs.model.wadl.WadlGenerator">
>                                  <property
> name="useJaxbContextForQnames" value="true" />
>                                  <property
> name="addResourceAndMethodIds" value="true" />
>                          </bean>
>
> I've tried to:
> <bean class="org.apache.cxf.jaxrs.model.wadl.WadlGenerator">
> <property name="useJaxbContextForQnames" value="true" />
> <property name="addResourceAndMethodIds" value="true" />
> <property name="schemaLocations">
> <list>
> <value>/xsd/common-v1.xsd</value>
> ........ additional schemas....
> </list>
> </property>
> </bean>
>
> also xsd/common-v1.xsd
> or
> classpath:xsd/common-v1.xsd
>
> none of them are able to find the schema:
> 2013-10-10 16:00:26,113 [main][][][][][][][] WARN
> org.apache.cxf.jaxrs.model.wadl.WadlGenerator - No schema resource
> /xsd/common-v1.xsd can be loaded : null
>
>
> the schemas are in another jarfile on the classpath - so not in the .war
> which contains cxf-servlet.xml which contains the above wadlgenerator config

Right. WadlGenerator needs a reference the bus to get such resources 
loaded properly; the only option I can see is to introduce a constructor 
accepting a bus, or optionally delay loading the external resources 
until WADL is actually requested...

FYI, the immediate workaround is as follows: create a WADL doc manually, 
and reference it from jaxrs:server/@docLocation.

In meantime I'll do a bit more work...

Sergey

>
>
> 2013/10/10 Sergey Beryozkin <sberyozkin@gmail.com
> <ma...@gmail.com>>
>
>     Hi David
>
>     I'm doing some work on it, following our conversation on IRC.
>     Let me double check one thing, do you configure WADLGenerator with
>     the list of schemas to be included in the grammar section ?
>
>     If not then WADLGenerator may have to create xsd:elements somehow
>     itself, similarly to the way it does it for explicit collections
>     like List<Book>, because JAXB won't generate itself xsd:element from
>     @XmlType only
>
>     Cheers. Sergey
>
>
>     On 08/10/13 09:34, David Karlsen wrote:
>
>         OK - been experimenting a little - it's due to missing
>         XmlRootElement
>         annotations.
>
>         If I "inline" the type definition it will work.
>         This works:
>         <element name="customerCreateRequest">
>         <complexType>
>         <annotation>
>         <documentation>
>         Create a new distinct customer.
>         Customers have distinct customerIds within an organization.
>         </documentation>
>         </annotation>
>         <sequence>
>         <element name="customer" type="customer:customerType" />
>         </sequence>
>         </complexType>
>         </element>
>
>         instead of the more reusable (will not work):
>         <element name="customerCreateRequest"
>         type="tns:__customerCreateRequest">
>
>
>         <complexType name="customerCreateRequest">
>         <annotation>
>         <documentation>
>         Create a new distinct customer.
>         Customers have distinct customerIds within an organization.
>         </documentation>
>         </annotation>
>         <sequence>
>         <element name="customer" type="customer:customerType" />
>         </sequence>
>         </complexType>
>
>
>         Is there no way around this?
>
>         I thought that was what @XmlName was for.
>
>
>
>         2013/10/7 David Karlsen <davidkarlsen@gmail.com
>         <ma...@gmail.com>>
>
>             Hi.
>
>             I did this:
>             @POST
>                   @Consumes( { MediaType.APPLICATION_XML} )
>                   @Produces( { MediaType.APPLICATION_XML } )
>                   public void testCreate( @XMLName( value =
>             "{urn:srv.jfr.tac.fs.edb.com:w__s:customer:v1}__customerCreateRequest"
>             ) CustomerCreateRequest customerCreateRequest ) {
>
>             And have also cleaned up the config.
>
>
>             2013/10/7 Sergey Beryozkin <sberyozkin@gmail.com
>             <ma...@gmail.com>>
>
>                 Hi David
>
>                 On 07/10/13 10:54, David Karlsen wrote:
>
>                     Hi.
>
>                     I have an existing jax-ws service that I now
>                     additionally want to expose
>                     as
>                     a REST/jax-rs service.
>                     I've configured it like this:
>                     *http://pastebin.com/h7cy8ZYB *
>                     The wadl generated looks like:
>                     *http://pastebin.com/QQRbNb3n *
>
>                     I would expect it to refer to the request /response
>                     types not to look
>                     like
>                     <representation mediaType="application/xml"/>
>
>                     but rather something like:
>                     <representation mediaType="application/xml"
>                     type="tns:**__customerCreateRequest" />
>
>
>                     I've tried adding @XmlName etc but nothing changes.
>
>
>                 I suspect the reason you don't have the proper mappings
>                 generated is that
>                 the JAX-WS generated code has the bean parameters with
>                 JAXB XMLType only
>                 and the JAX-RS runtime does wrap/unwrap the types.
>
>                 How do you use XMLName ? It needs to contain extended
>                 QNames, example "{
>                 http://myns}MyRootElement".
>
>                 As a side note, the configuration can be simplified:
>                 - two conflicting JAXB providers, need to drop either
>                 jaxrs:dataBinding
>                 or JAXBProvider,
>                 - two Jackson providers, I'm not sure which one will
>                 work better in your
>                 case, please try
>                 - re the schema validation, you need to get that schema
>                 list set up only
>                 once, using SchemaHandler makes sense only if you reuse
>                 it between CXF JAXB
>                 and JSON providers, but you don't, so drop it; next , if
>                 you decide to keep
>                 JAXBProvider then drop jaxrs:schemaLocations
>
>                 Cheers, Sergey
>
>
>
>
>
>                     Any hints?
>
>                     --
>                     David J. M. Karlsen -
>                     http://www.linkedin.com/in/**__davidkarlsen
>                     <http://www.linkedin.com/in/**davidkarlsen><http://www.__linkedin.com/in/davidkarlsen
>                     <http://www.linkedin.com/in/davidkarlsen>>
>
>
>
>
>
>             --
>             --
>             David J. M. Karlsen -
>             http://www.linkedin.com/in/__davidkarlsen
>             <http://www.linkedin.com/in/davidkarlsen>
>
>
>
>
>
>
>     --
>     Sergey Beryozkin
>
>     Talend Community Coders
>     http://coders.talend.com/
>
>     Blog: http://sberyozkin.blogspot.com
>
>
>
>
> --
> --
> David J. M. Karlsen - http://www.linkedin.com/in/davidkarlsen


Re: Getting proper wadl generated

Posted by Sergey Beryozkin <sb...@gmail.com>.
I've committed some changes to 2.7.x:

- XmlType only annotated classes should now be processed as expected,
the schema elements will be added in addition to what JAXB compiler 
generates, and the references from WADL reps to these elements should be 
visible
- @XMLName is not needed unless default XmlType processing needs to be 
customized

- added a WadlGenerator constructor accepting a Bus - this should help 
with loading the external resources not visible to the default 
loader/resolver, in case you'd like to reuse the existing schema resources

Give it a try please when you get a chance,
Sergey

On 10/10/13 15:20, David Karlsen wrote:
> No - I had it like this:
>   <bean class="org.apache.cxf.jaxrs.model.wadl.WadlGenerator">
>                                  <property
> name="useJaxbContextForQnames" value="true" />
>                                  <property
> name="addResourceAndMethodIds" value="true" />
>                          </bean>
>
> I've tried to:
> <bean class="org.apache.cxf.jaxrs.model.wadl.WadlGenerator">
> <property name="useJaxbContextForQnames" value="true" />
> <property name="addResourceAndMethodIds" value="true" />
> <property name="schemaLocations">
> <list>
> <value>/xsd/common-v1.xsd</value>
> ........ additional schemas....
> </list>
> </property>
> </bean>
>
> also xsd/common-v1.xsd
> or
> classpath:xsd/common-v1.xsd
>
> none of them are able to find the schema:
> 2013-10-10 16:00:26,113 [main][][][][][][][] WARN
> org.apache.cxf.jaxrs.model.wadl.WadlGenerator - No schema resource
> /xsd/common-v1.xsd can be loaded : null
>
>
> the schemas are in another jarfile on the classpath - so not in the .war
> which contains cxf-servlet.xml which contains the above wadlgenerator config
>
>
> 2013/10/10 Sergey Beryozkin <sberyozkin@gmail.com
> <ma...@gmail.com>>
>
>     Hi David
>
>     I'm doing some work on it, following our conversation on IRC.
>     Let me double check one thing, do you configure WADLGenerator with
>     the list of schemas to be included in the grammar section ?
>
>     If not then WADLGenerator may have to create xsd:elements somehow
>     itself, similarly to the way it does it for explicit collections
>     like List<Book>, because JAXB won't generate itself xsd:element from
>     @XmlType only
>
>     Cheers. Sergey
>
>
>     On 08/10/13 09:34, David Karlsen wrote:
>
>         OK - been experimenting a little - it's due to missing
>         XmlRootElement
>         annotations.
>
>         If I "inline" the type definition it will work.
>         This works:
>         <element name="customerCreateRequest">
>         <complexType>
>         <annotation>
>         <documentation>
>         Create a new distinct customer.
>         Customers have distinct customerIds within an organization.
>         </documentation>
>         </annotation>
>         <sequence>
>         <element name="customer" type="customer:customerType" />
>         </sequence>
>         </complexType>
>         </element>
>
>         instead of the more reusable (will not work):
>         <element name="customerCreateRequest"
>         type="tns:__customerCreateRequest">
>
>
>         <complexType name="customerCreateRequest">
>         <annotation>
>         <documentation>
>         Create a new distinct customer.
>         Customers have distinct customerIds within an organization.
>         </documentation>
>         </annotation>
>         <sequence>
>         <element name="customer" type="customer:customerType" />
>         </sequence>
>         </complexType>
>
>
>         Is there no way around this?
>
>         I thought that was what @XmlName was for.
>
>
>
>         2013/10/7 David Karlsen <davidkarlsen@gmail.com
>         <ma...@gmail.com>>
>
>             Hi.
>
>             I did this:
>             @POST
>                   @Consumes( { MediaType.APPLICATION_XML} )
>                   @Produces( { MediaType.APPLICATION_XML } )
>                   public void testCreate( @XMLName( value =
>             "{urn:srv.jfr.tac.fs.edb.com:w__s:customer:v1}__customerCreateRequest"
>             ) CustomerCreateRequest customerCreateRequest ) {
>
>             And have also cleaned up the config.
>
>
>             2013/10/7 Sergey Beryozkin <sberyozkin@gmail.com
>             <ma...@gmail.com>>
>
>                 Hi David
>
>                 On 07/10/13 10:54, David Karlsen wrote:
>
>                     Hi.
>
>                     I have an existing jax-ws service that I now
>                     additionally want to expose
>                     as
>                     a REST/jax-rs service.
>                     I've configured it like this:
>                     *http://pastebin.com/h7cy8ZYB *
>                     The wadl generated looks like:
>                     *http://pastebin.com/QQRbNb3n *
>
>                     I would expect it to refer to the request /response
>                     types not to look
>                     like
>                     <representation mediaType="application/xml"/>
>
>                     but rather something like:
>                     <representation mediaType="application/xml"
>                     type="tns:**__customerCreateRequest" />
>
>
>                     I've tried adding @XmlName etc but nothing changes.
>
>
>                 I suspect the reason you don't have the proper mappings
>                 generated is that
>                 the JAX-WS generated code has the bean parameters with
>                 JAXB XMLType only
>                 and the JAX-RS runtime does wrap/unwrap the types.
>
>                 How do you use XMLName ? It needs to contain extended
>                 QNames, example "{
>                 http://myns}MyRootElement".
>
>                 As a side note, the configuration can be simplified:
>                 - two conflicting JAXB providers, need to drop either
>                 jaxrs:dataBinding
>                 or JAXBProvider,
>                 - two Jackson providers, I'm not sure which one will
>                 work better in your
>                 case, please try
>                 - re the schema validation, you need to get that schema
>                 list set up only
>                 once, using SchemaHandler makes sense only if you reuse
>                 it between CXF JAXB
>                 and JSON providers, but you don't, so drop it; next , if
>                 you decide to keep
>                 JAXBProvider then drop jaxrs:schemaLocations
>
>                 Cheers, Sergey
>
>
>
>
>
>                     Any hints?
>
>                     --
>                     David J. M. Karlsen -
>                     http://www.linkedin.com/in/**__davidkarlsen
>                     <http://www.linkedin.com/in/**davidkarlsen><http://www.__linkedin.com/in/davidkarlsen
>                     <http://www.linkedin.com/in/davidkarlsen>>
>
>
>
>
>
>             --
>             --
>             David J. M. Karlsen -
>             http://www.linkedin.com/in/__davidkarlsen
>             <http://www.linkedin.com/in/davidkarlsen>
>
>
>
>
>
>
>     --
>     Sergey Beryozkin
>
>     Talend Community Coders
>     http://coders.talend.com/
>
>     Blog: http://sberyozkin.blogspot.com
>
>
>
>
> --
> --
> David J. M. Karlsen - http://www.linkedin.com/in/davidkarlsen


-- 
Sergey Beryozkin

Talend Community Coders
http://coders.talend.com/

Blog: http://sberyozkin.blogspot.com

Re: Getting proper wadl generated

Posted by David Karlsen <da...@gmail.com>.
No - I had it like this:
 <bean class="org.apache.cxf.jaxrs.model.wadl.WadlGenerator">
                                <property name="useJaxbContextForQnames"
value="true" />
                                <property name="addResourceAndMethodIds"
value="true" />
                        </bean>

I've tried to:
<bean class="org.apache.cxf.jaxrs.model.wadl.WadlGenerator">
<property name="useJaxbContextForQnames" value="true" />
<property name="addResourceAndMethodIds" value="true" />
<property name="schemaLocations">
<list>
<value>/xsd/common-v1.xsd</value>
........ additional schemas....
</list>
</property>
</bean>

also xsd/common-v1.xsd
or
classpath:xsd/common-v1.xsd

none of them are able to find the schema:
2013-10-10 16:00:26,113 [main][][][][][][][] WARN
org.apache.cxf.jaxrs.model.wadl.WadlGenerator - No schema resource
/xsd/common-v1.xsd can be loaded : null


the schemas are in another jarfile on the classpath - so not in the .war
which contains cxf-servlet.xml which contains the above wadlgenerator config


2013/10/10 Sergey Beryozkin <sb...@gmail.com>

> Hi David
>
> I'm doing some work on it, following our conversation on IRC.
> Let me double check one thing, do you configure WADLGenerator with the
> list of schemas to be included in the grammar section ?
>
> If not then WADLGenerator may have to create xsd:elements somehow itself,
> similarly to the way it does it for explicit collections like List<Book>,
> because JAXB won't generate itself xsd:element from @XmlType only
>
> Cheers. Sergey
>
>
> On 08/10/13 09:34, David Karlsen wrote:
>
>> OK - been experimenting a little - it's due to missing XmlRootElement
>> annotations.
>>
>> If I "inline" the type definition it will work.
>> This works:
>> <element name="customerCreateRequest">
>> <complexType>
>> <annotation>
>> <documentation>
>> Create a new distinct customer.
>> Customers have distinct customerIds within an organization.
>> </documentation>
>> </annotation>
>> <sequence>
>> <element name="customer" type="customer:customerType" />
>> </sequence>
>> </complexType>
>> </element>
>>
>> instead of the more reusable (will not work):
>> <element name="customerCreateRequest" type="tns:**customerCreateRequest">
>>
>>
>> <complexType name="customerCreateRequest">
>> <annotation>
>> <documentation>
>> Create a new distinct customer.
>> Customers have distinct customerIds within an organization.
>> </documentation>
>> </annotation>
>> <sequence>
>> <element name="customer" type="customer:customerType" />
>> </sequence>
>> </complexType>
>>
>>
>> Is there no way around this?
>>
>> I thought that was what @XmlName was for.
>>
>>
>>
>> 2013/10/7 David Karlsen <da...@gmail.com>
>>
>>  Hi.
>>>
>>> I did this:
>>> @POST
>>>      @Consumes( { MediaType.APPLICATION_XML} )
>>>      @Produces( { MediaType.APPLICATION_XML } )
>>>      public void testCreate( @XMLName( value =
>>> "{urn:srv.jfr.tac.fs.edb.com:w**s:customer:v1}**customerCreateRequest"
>>> ) CustomerCreateRequest customerCreateRequest ) {
>>>
>>> And have also cleaned up the config.
>>>
>>>
>>> 2013/10/7 Sergey Beryozkin <sb...@gmail.com>
>>>
>>>  Hi David
>>>>
>>>> On 07/10/13 10:54, David Karlsen wrote:
>>>>
>>>>  Hi.
>>>>>
>>>>> I have an existing jax-ws service that I now additionally want to
>>>>> expose
>>>>> as
>>>>> a REST/jax-rs service.
>>>>> I've configured it like this: *http://pastebin.com/h7cy8ZYB *
>>>>> The wadl generated looks like: *http://pastebin.com/QQRbNb3n *
>>>>>
>>>>> I would expect it to refer to the request /response types not to look
>>>>> like
>>>>> <representation mediaType="application/xml"/>
>>>>>
>>>>> but rather something like:
>>>>> <representation mediaType="application/xml"
>>>>> type="tns:****customerCreateRequest" />
>>>>>
>>>>>
>>>>> I've tried adding @XmlName etc but nothing changes.
>>>>>
>>>>>
>>>> I suspect the reason you don't have the proper mappings generated is
>>>> that
>>>> the JAX-WS generated code has the bean parameters with JAXB XMLType only
>>>> and the JAX-RS runtime does wrap/unwrap the types.
>>>>
>>>> How do you use XMLName ? It needs to contain extended QNames, example "{
>>>> http://myns}MyRootElement".
>>>>
>>>> As a side note, the configuration can be simplified:
>>>> - two conflicting JAXB providers, need to drop either jaxrs:dataBinding
>>>> or JAXBProvider,
>>>> - two Jackson providers, I'm not sure which one will work better in your
>>>> case, please try
>>>> - re the schema validation, you need to get that schema list set up only
>>>> once, using SchemaHandler makes sense only if you reuse it between CXF
>>>> JAXB
>>>> and JSON providers, but you don't, so drop it; next , if you decide to
>>>> keep
>>>> JAXBProvider then drop jaxrs:schemaLocations
>>>>
>>>> Cheers, Sergey
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>  Any hints?
>>>>>
>>>>> --
>>>>> David J. M. Karlsen - http://www.linkedin.com/in/****davidkarlsen<http://www.linkedin.com/in/**davidkarlsen>
>>>>> <http://www.**linkedin.com/in/davidkarlsen<http://www.linkedin.com/in/davidkarlsen>
>>>>> >
>>>>>
>>>>>
>>>>>
>>>>
>>>
>>> --
>>> --
>>> David J. M. Karlsen - http://www.linkedin.com/in/**davidkarlsen<http://www.linkedin.com/in/davidkarlsen>
>>>
>>>
>>
>>
>>
>
> --
> Sergey Beryozkin
>
> Talend Community Coders
> http://coders.talend.com/
>
> Blog: http://sberyozkin.blogspot.com
>



-- 
--
David J. M. Karlsen - http://www.linkedin.com/in/davidkarlsen

Re: Getting proper wadl generated

Posted by David Karlsen <da...@gmail.com>.
I build the branch 2.7.x-fixes branch locally my self.
Works like a charm!
Excellent!


2013/10/10 Sergey Beryozkin <sb...@gmail.com>

> Hi David
>
> I'm doing some work on it, following our conversation on IRC.
> Let me double check one thing, do you configure WADLGenerator with the
> list of schemas to be included in the grammar section ?
>
> If not then WADLGenerator may have to create xsd:elements somehow itself,
> similarly to the way it does it for explicit collections like List<Book>,
> because JAXB won't generate itself xsd:element from @XmlType only
>
> Cheers. Sergey
>
>
> On 08/10/13 09:34, David Karlsen wrote:
>
>> OK - been experimenting a little - it's due to missing XmlRootElement
>> annotations.
>>
>> If I "inline" the type definition it will work.
>> This works:
>> <element name="customerCreateRequest">
>> <complexType>
>> <annotation>
>> <documentation>
>> Create a new distinct customer.
>> Customers have distinct customerIds within an organization.
>> </documentation>
>> </annotation>
>> <sequence>
>> <element name="customer" type="customer:customerType" />
>> </sequence>
>> </complexType>
>> </element>
>>
>> instead of the more reusable (will not work):
>> <element name="customerCreateRequest" type="tns:**customerCreateRequest">
>>
>>
>> <complexType name="customerCreateRequest">
>> <annotation>
>> <documentation>
>> Create a new distinct customer.
>> Customers have distinct customerIds within an organization.
>> </documentation>
>> </annotation>
>> <sequence>
>> <element name="customer" type="customer:customerType" />
>> </sequence>
>> </complexType>
>>
>>
>> Is there no way around this?
>>
>> I thought that was what @XmlName was for.
>>
>>
>>
>> 2013/10/7 David Karlsen <da...@gmail.com>
>>
>>  Hi.
>>>
>>> I did this:
>>> @POST
>>>      @Consumes( { MediaType.APPLICATION_XML} )
>>>      @Produces( { MediaType.APPLICATION_XML } )
>>>      public void testCreate( @XMLName( value =
>>> "{urn:srv.jfr.tac.fs.edb.com:w**s:customer:v1}**customerCreateRequest"
>>> ) CustomerCreateRequest customerCreateRequest ) {
>>>
>>> And have also cleaned up the config.
>>>
>>>
>>> 2013/10/7 Sergey Beryozkin <sb...@gmail.com>
>>>
>>>  Hi David
>>>>
>>>> On 07/10/13 10:54, David Karlsen wrote:
>>>>
>>>>  Hi.
>>>>>
>>>>> I have an existing jax-ws service that I now additionally want to
>>>>> expose
>>>>> as
>>>>> a REST/jax-rs service.
>>>>> I've configured it like this: *http://pastebin.com/h7cy8ZYB *
>>>>> The wadl generated looks like: *http://pastebin.com/QQRbNb3n *
>>>>>
>>>>> I would expect it to refer to the request /response types not to look
>>>>> like
>>>>> <representation mediaType="application/xml"/>
>>>>>
>>>>> but rather something like:
>>>>> <representation mediaType="application/xml"
>>>>> type="tns:****customerCreateRequest" />
>>>>>
>>>>>
>>>>> I've tried adding @XmlName etc but nothing changes.
>>>>>
>>>>>
>>>> I suspect the reason you don't have the proper mappings generated is
>>>> that
>>>> the JAX-WS generated code has the bean parameters with JAXB XMLType only
>>>> and the JAX-RS runtime does wrap/unwrap the types.
>>>>
>>>> How do you use XMLName ? It needs to contain extended QNames, example "{
>>>> http://myns}MyRootElement".
>>>>
>>>> As a side note, the configuration can be simplified:
>>>> - two conflicting JAXB providers, need to drop either jaxrs:dataBinding
>>>> or JAXBProvider,
>>>> - two Jackson providers, I'm not sure which one will work better in your
>>>> case, please try
>>>> - re the schema validation, you need to get that schema list set up only
>>>> once, using SchemaHandler makes sense only if you reuse it between CXF
>>>> JAXB
>>>> and JSON providers, but you don't, so drop it; next , if you decide to
>>>> keep
>>>> JAXBProvider then drop jaxrs:schemaLocations
>>>>
>>>> Cheers, Sergey
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>  Any hints?
>>>>>
>>>>> --
>>>>> David J. M. Karlsen - http://www.linkedin.com/in/****davidkarlsen<http://www.linkedin.com/in/**davidkarlsen>
>>>>> <http://www.**linkedin.com/in/davidkarlsen<http://www.linkedin.com/in/davidkarlsen>
>>>>> >
>>>>>
>>>>>
>>>>>
>>>>
>>>
>>> --
>>> --
>>> David J. M. Karlsen - http://www.linkedin.com/in/**davidkarlsen<http://www.linkedin.com/in/davidkarlsen>
>>>
>>>
>>
>>
>>
>
> --
> Sergey Beryozkin
>
> Talend Community Coders
> http://coders.talend.com/
>
> Blog: http://sberyozkin.blogspot.com
>



-- 
--
David J. M. Karlsen - http://www.linkedin.com/in/davidkarlsen

Re: Getting proper wadl generated

Posted by Sergey Beryozkin <sb...@gmail.com>.
Hi David

I'm doing some work on it, following our conversation on IRC.
Let me double check one thing, do you configure WADLGenerator with the 
list of schemas to be included in the grammar section ?

If not then WADLGenerator may have to create xsd:elements somehow 
itself, similarly to the way it does it for explicit collections like 
List<Book>, because JAXB won't generate itself xsd:element from @XmlType 
only

Cheers. Sergey

On 08/10/13 09:34, David Karlsen wrote:
> OK - been experimenting a little - it's due to missing XmlRootElement
> annotations.
>
> If I "inline" the type definition it will work.
> This works:
> <element name="customerCreateRequest">
> <complexType>
> <annotation>
> <documentation>
> Create a new distinct customer.
> Customers have distinct customerIds within an organization.
> </documentation>
> </annotation>
> <sequence>
> <element name="customer" type="customer:customerType" />
> </sequence>
> </complexType>
> </element>
>
> instead of the more reusable (will not work):
> <element name="customerCreateRequest" type="tns:customerCreateRequest">
>
>
> <complexType name="customerCreateRequest">
> <annotation>
> <documentation>
> Create a new distinct customer.
> Customers have distinct customerIds within an organization.
> </documentation>
> </annotation>
> <sequence>
> <element name="customer" type="customer:customerType" />
> </sequence>
> </complexType>
>
>
> Is there no way around this?
>
> I thought that was what @XmlName was for.
>
>
>
> 2013/10/7 David Karlsen <da...@gmail.com>
>
>> Hi.
>>
>> I did this:
>> @POST
>>      @Consumes( { MediaType.APPLICATION_XML} )
>>      @Produces( { MediaType.APPLICATION_XML } )
>>      public void testCreate( @XMLName( value = "{urn:srv.jfr.tac.fs.edb.com:ws:customer:v1}customerCreateRequest"
>> ) CustomerCreateRequest customerCreateRequest ) {
>>
>> And have also cleaned up the config.
>>
>>
>> 2013/10/7 Sergey Beryozkin <sb...@gmail.com>
>>
>>> Hi David
>>>
>>> On 07/10/13 10:54, David Karlsen wrote:
>>>
>>>> Hi.
>>>>
>>>> I have an existing jax-ws service that I now additionally want to expose
>>>> as
>>>> a REST/jax-rs service.
>>>> I've configured it like this: *http://pastebin.com/h7cy8ZYB *
>>>> The wadl generated looks like: *http://pastebin.com/QQRbNb3n *
>>>>
>>>> I would expect it to refer to the request /response types not to look
>>>> like
>>>> <representation mediaType="application/xml"/>
>>>>
>>>> but rather something like:
>>>> <representation mediaType="application/xml"
>>>> type="tns:**customerCreateRequest" />
>>>>
>>>> I've tried adding @XmlName etc but nothing changes.
>>>>
>>>
>>> I suspect the reason you don't have the proper mappings generated is that
>>> the JAX-WS generated code has the bean parameters with JAXB XMLType only
>>> and the JAX-RS runtime does wrap/unwrap the types.
>>>
>>> How do you use XMLName ? It needs to contain extended QNames, example "{
>>> http://myns}MyRootElement".
>>>
>>> As a side note, the configuration can be simplified:
>>> - two conflicting JAXB providers, need to drop either jaxrs:dataBinding
>>> or JAXBProvider,
>>> - two Jackson providers, I'm not sure which one will work better in your
>>> case, please try
>>> - re the schema validation, you need to get that schema list set up only
>>> once, using SchemaHandler makes sense only if you reuse it between CXF JAXB
>>> and JSON providers, but you don't, so drop it; next , if you decide to keep
>>> JAXBProvider then drop jaxrs:schemaLocations
>>>
>>> Cheers, Sergey
>>>
>>>
>>>
>>>
>>>
>>>> Any hints?
>>>>
>>>> --
>>>> David J. M. Karlsen - http://www.linkedin.com/in/**davidkarlsen<http://www.linkedin.com/in/davidkarlsen>
>>>>
>>>>
>>>
>>
>>
>> --
>> --
>> David J. M. Karlsen - http://www.linkedin.com/in/davidkarlsen
>>
>
>
>


-- 
Sergey Beryozkin

Talend Community Coders
http://coders.talend.com/

Blog: http://sberyozkin.blogspot.com

Re: Getting proper wadl generated

Posted by David Karlsen <da...@gmail.com>.
OK - been experimenting a little - it's due to missing XmlRootElement
annotations.

If I "inline" the type definition it will work.
This works:
<element name="customerCreateRequest">
<complexType>
<annotation>
<documentation>
Create a new distinct customer.
Customers have distinct customerIds within an organization.
</documentation>
</annotation>
<sequence>
<element name="customer" type="customer:customerType" />
</sequence>
</complexType>
</element>

instead of the more reusable (will not work):
<element name="customerCreateRequest" type="tns:customerCreateRequest">


<complexType name="customerCreateRequest">
<annotation>
<documentation>
Create a new distinct customer.
Customers have distinct customerIds within an organization.
</documentation>
</annotation>
<sequence>
<element name="customer" type="customer:customerType" />
</sequence>
</complexType>


Is there no way around this?

I thought that was what @XmlName was for.



2013/10/7 David Karlsen <da...@gmail.com>

> Hi.
>
> I did this:
> @POST
>     @Consumes( { MediaType.APPLICATION_XML} )
>     @Produces( { MediaType.APPLICATION_XML } )
>     public void testCreate( @XMLName( value = "{urn:srv.jfr.tac.fs.edb.com:ws:customer:v1}customerCreateRequest"
> ) CustomerCreateRequest customerCreateRequest ) {
>
> And have also cleaned up the config.
>
>
> 2013/10/7 Sergey Beryozkin <sb...@gmail.com>
>
>> Hi David
>>
>> On 07/10/13 10:54, David Karlsen wrote:
>>
>>> Hi.
>>>
>>> I have an existing jax-ws service that I now additionally want to expose
>>> as
>>> a REST/jax-rs service.
>>> I've configured it like this: *http://pastebin.com/h7cy8ZYB *
>>> The wadl generated looks like: *http://pastebin.com/QQRbNb3n *
>>>
>>> I would expect it to refer to the request /response types not to look
>>> like
>>> <representation mediaType="application/xml"/>
>>>
>>> but rather something like:
>>> <representation mediaType="application/xml"
>>> type="tns:**customerCreateRequest" />
>>>
>>> I've tried adding @XmlName etc but nothing changes.
>>>
>>
>> I suspect the reason you don't have the proper mappings generated is that
>> the JAX-WS generated code has the bean parameters with JAXB XMLType only
>> and the JAX-RS runtime does wrap/unwrap the types.
>>
>> How do you use XMLName ? It needs to contain extended QNames, example "{
>> http://myns}MyRootElement".
>>
>> As a side note, the configuration can be simplified:
>> - two conflicting JAXB providers, need to drop either jaxrs:dataBinding
>> or JAXBProvider,
>> - two Jackson providers, I'm not sure which one will work better in your
>> case, please try
>> - re the schema validation, you need to get that schema list set up only
>> once, using SchemaHandler makes sense only if you reuse it between CXF JAXB
>> and JSON providers, but you don't, so drop it; next , if you decide to keep
>> JAXBProvider then drop jaxrs:schemaLocations
>>
>> Cheers, Sergey
>>
>>
>>
>>
>>
>>> Any hints?
>>>
>>> --
>>> David J. M. Karlsen - http://www.linkedin.com/in/**davidkarlsen<http://www.linkedin.com/in/davidkarlsen>
>>>
>>>
>>
>
>
> --
> --
> David J. M. Karlsen - http://www.linkedin.com/in/davidkarlsen
>



-- 
--
David J. M. Karlsen - http://www.linkedin.com/in/davidkarlsen

Re: Getting proper wadl generated

Posted by David Karlsen <da...@gmail.com>.
Hi.

I did this:
@POST
    @Consumes( { MediaType.APPLICATION_XML} )
    @Produces( { MediaType.APPLICATION_XML } )
    public void testCreate( @XMLName( value =
"{urn:srv.jfr.tac.fs.edb.com:ws:customer:v1}customerCreateRequest"
) CustomerCreateRequest customerCreateRequest ) {

And have also cleaned up the config.


2013/10/7 Sergey Beryozkin <sb...@gmail.com>

> Hi David
>
> On 07/10/13 10:54, David Karlsen wrote:
>
>> Hi.
>>
>> I have an existing jax-ws service that I now additionally want to expose
>> as
>> a REST/jax-rs service.
>> I've configured it like this: *http://pastebin.com/h7cy8ZYB *
>> The wadl generated looks like: *http://pastebin.com/QQRbNb3n *
>>
>> I would expect it to refer to the request /response types not to look like
>> <representation mediaType="application/xml"/>
>>
>> but rather something like:
>> <representation mediaType="application/xml"
>> type="tns:**customerCreateRequest" />
>>
>> I've tried adding @XmlName etc but nothing changes.
>>
>
> I suspect the reason you don't have the proper mappings generated is that
> the JAX-WS generated code has the bean parameters with JAXB XMLType only
> and the JAX-RS runtime does wrap/unwrap the types.
>
> How do you use XMLName ? It needs to contain extended QNames, example "{
> http://myns}MyRootElement".
>
> As a side note, the configuration can be simplified:
> - two conflicting JAXB providers, need to drop either jaxrs:dataBinding or
> JAXBProvider,
> - two Jackson providers, I'm not sure which one will work better in your
> case, please try
> - re the schema validation, you need to get that schema list set up only
> once, using SchemaHandler makes sense only if you reuse it between CXF JAXB
> and JSON providers, but you don't, so drop it; next , if you decide to keep
> JAXBProvider then drop jaxrs:schemaLocations
>
> Cheers, Sergey
>
>
>
>
>
>> Any hints?
>>
>> --
>> David J. M. Karlsen - http://www.linkedin.com/in/**davidkarlsen<http://www.linkedin.com/in/davidkarlsen>
>>
>>
>


-- 
--
David J. M. Karlsen - http://www.linkedin.com/in/davidkarlsen

Re: Getting proper wadl generated

Posted by Sergey Beryozkin <sb...@gmail.com>.
Hi David
On 07/10/13 10:54, David Karlsen wrote:
> Hi.
>
> I have an existing jax-ws service that I now additionally want to expose as
> a REST/jax-rs service.
> I've configured it like this: *http://pastebin.com/h7cy8ZYB *
> The wadl generated looks like: *http://pastebin.com/QQRbNb3n *
> I would expect it to refer to the request /response types not to look like
> <representation mediaType="application/xml"/>
>
> but rather something like:
> <representation mediaType="application/xml"
> type="tns:customerCreateRequest" />
>
> I've tried adding @XmlName etc but nothing changes.

I suspect the reason you don't have the proper mappings generated is 
that the JAX-WS generated code has the bean parameters with JAXB XMLType 
only and the JAX-RS runtime does wrap/unwrap the types.

How do you use XMLName ? It needs to contain extended QNames, example 
"{http://myns}MyRootElement".

As a side note, the configuration can be simplified:
- two conflicting JAXB providers, need to drop either jaxrs:dataBinding 
or JAXBProvider,
- two Jackson providers, I'm not sure which one will work better in your 
case, please try
- re the schema validation, you need to get that schema list set up only 
once, using SchemaHandler makes sense only if you reuse it between CXF 
JAXB and JSON providers, but you don't, so drop it; next , if you decide 
to keep JAXBProvider then drop jaxrs:schemaLocations

Cheers, Sergey



>
> Any hints?
>
> --
> David J. M. Karlsen - http://www.linkedin.com/in/davidkarlsen
>