camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sanjay Bhattacharya <san...@gmail.com>
Subject Re: camel-cxf problem exception
Date Sat, 11 Jan 2014 16:36:07 GMT
You can do this:

MessageContentsList msgContentList =
exchange.getOut().getBody(MessageContentsList.class);
msgContentList.add(fileList);

Thanks,
Sanjay


On Sat, Jan 11, 2014 at 1:02 AM, nono <yan.wang@db-is.com> wrote:

> Dear all,I encounter a camel-cxf  's cxf:bean problemit seems , it works
> with
> return type as pojo but failed with ListI got example at karaf like Below.
> Could anyone give some hints?Thanks in advance!WARNING: Interceptor for
> {
> http://ws.foo.com/}FileServiceService#{http://ws.fuse.emerald.dbis.com/}getPDFs
> has thrown exception, unwinding noworg.apache.cxf.interceptor.Fault
> at
>
> org.apache.cxf.databinding.AbstractWrapperHelper.createWrapperObject(AbstractWrapperHelper.java:107)
> at
>
> org.apache.cxf.jaxws.interceptors.WrapperClassOutInterceptor.handleMessage(WrapperClassOutInterceptor.java:105)
> at
>
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:263)
> at
>
> org.apache.cxf.interceptor.OutgoingChainInterceptor.handleMessage(OutgoingChainInterceptor.java:77)
> at
>
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:26Below
> are my blueprint and example
>
> code##################################################################define
> web service Endpoint           //define route , using cxf:bean , the real
> web service will be implemented by com.foo.camel.FileProcessor
> public class FileProcessor implements Processor {    @Override    public
> void process(Exchange exchng) throws Exception {                 //
> .......           it works with return type as pojo but failed with List
> //                   List fileList = results;
> exchng.getOut().setBody( fileList );        } catch (Exception e) {
> throw new FileNotFoundException("Something goes wrong in "
> +this.getClass().getName(), e);        }    }}// proxy web serivce,
> cxf:bean
> refers to itimport javax.jws.WebMethod;import javax.jws.WebParam;import
> javax.jws.WebResult;import javax.jws.WebService;import java.util.List;/** *
> */@WebServicepublic class FileService {    /**     * Web service operation
> */    @WebMethod(operationName = "getfile")    @WebResult(name = "file")
> public ReceivedPDF getfile(@WebParam(name = "fileName") String fileName)
> throws Exception{        //TODO write your implementation code here:
> return null;    }    /**     * Web service operation     */
> @WebMethod(operationName = "getfiles")    @WebResult(name = "files")
> public List getfiles(@WebParam(name = "fileNames") List fileNames) throws
> Exception{               return null;    }                }
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/camel-cxf-problem-exception-tp5745851.html
> Sent from the Camel - Users mailing list archive at Nabble.com.

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message