views:

234

answers:

1

How can I use instances of java.util.Locale as parameter or result in a webservice?

My webservice uses Apache CXF.

+1  A: 

The only way to do so is to use an XmlTypeAdapter to map the Locale object into something that JAXB can understand. Check the JAXB docs for instructions about the type adapters. CXF also has an example in the java_first_jaxws sample folder for mapping some interface things into stuff that JAXB can understand. Very similar concept here.

Daniel Kulp