Hi

I guess it would be more of a Camel specific issue. I believe in the CXFRS case the method selection is implicit.

Though what is quite relevant to the CXF list is that if you indeed meant to have request1() and request2() methods have the same JAXRS annotations then there will be no predictability at the JAXRS level which method gets selected, probably request1() will be selected all the time, this is due to the fact both methods are completely equal JAX-RS resource method candidates

HTH, Sergey
On 06/03/17 14:25, Stefan Alex wrote:
Hello ,
  I have another question if is possible please .

If I had cxf:rsServer register like this

<cxf:rsServer id="rsServer" address="/rest/"
    serviceClass="com.xxx.service.InboundService"
    loggingFeatureEnabled="true" loggingSizeLimit="99999">
    <cxf:providers>
       <ref bean="jsonProvider"/>
    </cxf:providers>
  </cxf:rsServer>
and
<bean id="serviceHandler" class="com.xxxx.service.RestHandler">

And in the com.xxx.service.InboundService I had two methods like this :

@POST
@Path("/createIncident1")
@Produces("application/json")
public void request1(InboundModel inboundModel)

and
@POST
@Path("/createIncident2")
@Produces("application/json")
public void request2(InboundModel inboundModel)


How can I process the two methods in the route , based on the request ?

 <camelContext id="camel" xmlns="http://camel.apache.org/schema/spring";>
    <route>

       <from uri="cxfrs://bean://rsServer"/>
       <to uri="bean:serviceHandler?method=processRequest1"/>  <-- for
process  post https://localhost/rest/request1 -- >


       <to uri="bean:serviceHandler?method=processRequest2"/>
<-- for process  post https://localhost/rest/request2 -- >
       <to uri="log:body?level=INFO"/>

    </route>
  </camelContext>


Any hints or help is really appreciated

Many thanks in advance ,
Stefan



--
View this message in context: 
http://cxf.547215.n5.nabble.com/cxf-rsServer-handle-different-methods-into-serviceClass-tp5777793.html
Sent from the cxf-user mailing list archive at Nabble.com.



--
Sergey Beryozkin

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

Reply via email to