cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Alex <abste...@gmail.com>
Subject cxf:rsServer handle different methods into serviceClass
Date Mon, 06 Mar 2017 14:25:41 GMT
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.

Mime
View raw message