cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrei Shakirin <ashaki...@talend.com>
Subject RE: cxf:rsServer handle different methods into serviceClass
Date Tue, 07 Mar 2017 21:59:09 GMT
Hi Stefan,

You can do something like this in your camel processor to distinguish your method:

public void process(Exchange exchange) throws Exception {
                    Message inMessage = exchange.getIn();                  
                    String operationName = inMessage.getHeader(CxfConstants.OPERATION_NAME,
String.class);
                    If ("request1".equals(operationName)) {
                      ...
                    } else if("request2".equals(operationName)) {
                      ...
                    }

Regards,
Andrei.

> -----Original Message-----
> From: Stefan Alex [mailto:abstefan@gmail.com]
> Sent: Montag, 6. März 2017 16:51
> To: users@cxf.apache.org
> Subject: Re: cxf:rsServer handle different methods into serviceClass
> 
> Hello ,
>    Thank you very much - but how can I process this requests in the end ?
> @POST
> @Path("/createRequest1")
> @Produces("application/json")
> public void request1(VistaraInboundModel inboundModel)
> 
> and
> @POST
> @Path("/createRequest2")
> @Produces("application/json")
> public void request2(VistaraInboundModel inboundModel)
> 
> Should I build a <cxf:rsServer  .. >  for handle createRequest1 and another for
> handle createRequest2 ?
> One <cxf:rsServer  .. > can not handle multiple requests ?
> In Spring is possible to register rest controller to handle multiples requests ,
> here we dont't have something similar ?
> 
> Many thanks in advance ,
> Stefan
> 
> 
> 
> 
> --
> View this message in context: http://cxf.547215.n5.nabble.com/cxf-rsServer-
> handle-different-methods-into-serviceClass-tp5777793p5777800.html
> Sent from the cxf-user mailing list archive at Nabble.com.

Mime
View raw message