You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by dermoritz <ta...@hotmail.com> on 2014/11/18 09:54:47 UTC

camel cxf convert comma separated string to one parameter - how to escape comma

I want to send a comma separated string to simple web service (cxf based).
Without comma all works fine. Camel's type converters and magic take the
string and find the only method that takes a string in wsdl and generate the
xml (the wsdl has only one method at all). If i send a comma separated
string i get an error because the type converter or something else
interprets the string as multiple parameters and no method matches.

Is there a way to supress or escape the ',' to let camel use it as single
parameter?



--
View this message in context: http://camel.465427.n5.nabble.com/camel-cxf-convert-comma-separated-string-to-one-parameter-how-to-escape-comma-tp5759243.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: camel cxf convert comma separated string to one parameter - how to escape comma

Posted by dermoritz <ta...@hotmail.com>.
Thanks this is working! List is working too, i use
Arrays.asList("one,parameter").

In meanwhile i tried to send the real payload object (used the generated
code), this is working on another CxfProducer in our project (no data mode
set!). 
But in this case camel tries to convert the xml-object back to a string and
i get exception. Here i have to explicitly set DataFormat to Cxf_Message?

So why in one case i could send "native payload" objects to cxf producer
without setting data mode (should be pojo by default) and in another case i
have to explicitly set data mode?




--
View this message in context: http://camel.465427.n5.nabble.com/camel-cxf-convert-comma-separated-string-to-one-parameter-how-to-escape-comma-tp5759243p5759257.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: camel cxf convert comma separated string to one parameter - how to escape comma

Posted by Willem Jiang <wi...@gmail.com>.
You may need to put the String parameter into Object array to avoid the type converter misfire. 

--  
Willem Jiang

Red Hat, Inc.
Web: http://www.redhat.com
Blog: http://willemjiang.blogspot.com (English)
http://jnn.iteye.com (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem



On November 18, 2014 at 4:55:44 PM, dermoritz (tanteanni@hotmail.com) wrote:
> I want to send a comma separated string to simple web service (cxf based).
> Without comma all works fine. Camel's type converters and magic take the
> string and find the only method that takes a string in wsdl and generate the
> xml (the wsdl has only one method at all). If i send a comma separated
> string i get an error because the type converter or something else
> interprets the string as multiple parameters and no method matches.
>  
> Is there a way to supress or escape the ',' to let camel use it as single
> parameter?
>  
>  
>  
> --
> View this message in context: http://camel.465427.n5.nabble.com/camel-cxf-convert-comma-separated-string-to-one-parameter-how-to-escape-comma-tp5759243.html  
> Sent from the Camel - Users mailing list archive at Nabble.com.
>