You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Marcel Stör <ma...@frightanic.com> on 2013/10/18 14:39:44 UTC
Service doc generation not working for JAX-RS
Are there known limitations for the "/services" and "?_wadl" auto doc
generation features when CXF serves both JAX-WS and JAX-RS?
[Context]
- CXF 2.7.5
- *1* CXF Servlet mapped to /* in web.xml
- JAX-WS endpoints like <jaxws:endpoint id= implementor= wsdlLocation=
address="/projection/1">
- JAX-RS server like so
<jaxrs:server id= address="/">
<jaxrs:serviceBeans>
<ref bean="taxV1RestService" />
- JAX-RS server like so
@Path("/tax/v1")
public class TaxV1RestService {
@Path("supported-kernel-years")
...
[Problem]
http://server/services returns the JAX-WS service list. That comes not
unexpected.
http://server/tax/v1/services also returns the JAX-WS service list
although /tax/v1 is the root path to a JAX-RS service.
http://server/tax/v1/supported_kernel_years?_wadl does not produce the
WADL of the JAX-RS endpoint but hits our custom interceptors and returns
[#document: null] in the end.
Do I need two CXF Servlets in web.xml to have auto doc generation play nice?
Regards,
Marcel
--
Marcel Stör, http://frightanic.com
Couchsurfing: http://www.couchsurfing.com/people/marcelstoer
O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
Re: Service doc generation not working for JAX-RS
Posted by Sergey Beryozkin <sb...@gmail.com>.
On 18/10/13 19:54, Marcel Stör wrote:
> On 18.10.2013 17:50, Sergey Beryozkin wrote:
>> Hi
>> On 18/10/13 13:39, Marcel Stör wrote:
>>> Are there known limitations for the "/services" and "?_wadl" auto doc
>>> generation features when CXF serves both JAX-WS and JAX-RS?
>>>
>>> [Context]
>>> - CXF 2.7.5
>>> - *1* CXF Servlet mapped to /* in web.xml
>>> - JAX-WS endpoints like <jaxws:endpoint id= implementor= wsdlLocation=
>>> address="/projection/1">
>>> - JAX-RS server like so
>>> <jaxrs:server id= address="/">
>>> <jaxrs:serviceBeans>
>>> <ref bean="taxV1RestService" />
>>> - JAX-RS server like so
>>> @Path("/tax/v1")
>>> public class TaxV1RestService {
>>> @Path("supported-kernel-years")
>>> ...
>>>
>>> [Problem]
>>> http://server/services returns the JAX-WS service list. That comes not
>>> unexpected.
>>> http://server/tax/v1/services also returns the JAX-WS service list
>>> although /tax/v1 is the root path to a JAX-RS service.
>>> http://server/tax/v1/supported_kernel_years?_wadl does not produce the
>>> WADL of the JAX-RS endpoint but hits our custom interceptors and returns
>>> [#document: null] in the end.
>>>
>>>
>>> Do I need two CXF Servlets in web.xml to have auto doc generation play
>>> nice?
>>
>> I'm thinking at the moment that the fact the addresses of both endpoints
>> overlap completely causes the issue, can you move "/tax" from the root
>> @Path to jaxrs:server/@address and have only @Path("/v1") and see what
>> happens ?
>
> I changed jaxrs:server/@address from '/' to '/rest'. So, the JAX-WS
> endpoints are all '/a-soap-endpoint', '/b-soap-endpoint' and so on and
> the JAX-RS services are at '/rest/tax/v1', '/rest/pension/v1', etc.
> However, requesting http://server/rest/services returns the JAX-WS
> service list.
>
Right, I think that what you expect is for the services list not to show
JAX-WS links when the request path covers JAX-RS endpoints and probably
vice versa ?
I don't think this is possible right now, but I guess we can have some
properties set at the endpoint creation time that can help the services
formatter handler to filter out some of the links
I'll have a look
Sergey
Re: Service doc generation not working for JAX-RS
Posted by Marcel Stör <ma...@frightanic.com>.
On 18.10.2013 17:50, Sergey Beryozkin wrote:
> Hi
> On 18/10/13 13:39, Marcel Stör wrote:
>> Are there known limitations for the "/services" and "?_wadl" auto doc
>> generation features when CXF serves both JAX-WS and JAX-RS?
>>
>> [Context]
>> - CXF 2.7.5
>> - *1* CXF Servlet mapped to /* in web.xml
>> - JAX-WS endpoints like <jaxws:endpoint id= implementor= wsdlLocation=
>> address="/projection/1">
>> - JAX-RS server like so
>> <jaxrs:server id= address="/">
>> <jaxrs:serviceBeans>
>> <ref bean="taxV1RestService" />
>> - JAX-RS server like so
>> @Path("/tax/v1")
>> public class TaxV1RestService {
>> @Path("supported-kernel-years")
>> ...
>>
>> [Problem]
>> http://server/services returns the JAX-WS service list. That comes not
>> unexpected.
>> http://server/tax/v1/services also returns the JAX-WS service list
>> although /tax/v1 is the root path to a JAX-RS service.
>> http://server/tax/v1/supported_kernel_years?_wadl does not produce the
>> WADL of the JAX-RS endpoint but hits our custom interceptors and returns
>> [#document: null] in the end.
>>
>>
>> Do I need two CXF Servlets in web.xml to have auto doc generation play
>> nice?
>
> I'm thinking at the moment that the fact the addresses of both endpoints
> overlap completely causes the issue, can you move "/tax" from the root
> @Path to jaxrs:server/@address and have only @Path("/v1") and see what
> happens ?
I changed jaxrs:server/@address from '/' to '/rest'. So, the JAX-WS
endpoints are all '/a-soap-endpoint', '/b-soap-endpoint' and so on and
the JAX-RS services are at '/rest/tax/v1', '/rest/pension/v1', etc.
However, requesting http://server/rest/services returns the JAX-WS
service list.
--
Marcel Stör, http://frightanic.com
Couchsurfing: http://www.couchsurfing.com/people/marcelstoer
O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
Re: Service doc generation not working for JAX-RS
Posted by Sergey Beryozkin <sb...@gmail.com>.
Hi
On 18/10/13 13:39, Marcel Stör wrote:
> Are there known limitations for the "/services" and "?_wadl" auto doc
> generation features when CXF serves both JAX-WS and JAX-RS?
>
> [Context]
> - CXF 2.7.5
> - *1* CXF Servlet mapped to /* in web.xml
> - JAX-WS endpoints like <jaxws:endpoint id= implementor= wsdlLocation=
> address="/projection/1">
> - JAX-RS server like so
> <jaxrs:server id= address="/">
> <jaxrs:serviceBeans>
> <ref bean="taxV1RestService" />
> - JAX-RS server like so
> @Path("/tax/v1")
> public class TaxV1RestService {
> @Path("supported-kernel-years")
> ...
>
> [Problem]
> http://server/services returns the JAX-WS service list. That comes not
> unexpected.
> http://server/tax/v1/services also returns the JAX-WS service list
> although /tax/v1 is the root path to a JAX-RS service.
> http://server/tax/v1/supported_kernel_years?_wadl does not produce the
> WADL of the JAX-RS endpoint but hits our custom interceptors and returns
> [#document: null] in the end.
>
>
> Do I need two CXF Servlets in web.xml to have auto doc generation play
> nice?
I'm thinking at the moment that the fact the addresses of both endpoints
overlap completely causes the issue, can you move "/tax" from the root
@Path to jaxrs:server/@address and have only @Path("/v1") and see what
happens ?
Thanks. Sergey
>
>
> Regards,
> Marcel
>
--
Sergey Beryozkin
Talend Community Coders
http://coders.talend.com/
Blog: http://sberyozkin.blogspot.com