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

679 views Asked by At

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?

2

There are 2 answers

0
soilworker On

maybe this is a duplicate of how to pass String including comma in CXF service method or CXF & Camel : IllegalArgumentException: Get the wrong parameter size to invoke the out service.

But if not, have you tried to encode/escape the comma in your request with a "\" before?

kind regards, soilworker

0
dermoritz On

how to pass String including comma in CXF service method is indeed a duplicate but with no accepted answer. But answer number one is working, but badly explained. So we use this ugly(the list will always only have one entry) code:

Arrays.asList("my, parameter, with, commas").