File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Web Services and the fly likes CXF and JAXB binding for a class/property with special character in its name? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "CXF and JAXB binding for a class/property with special character in its name?" Watch "CXF and JAXB binding for a class/property with special character in its name?" New topic
Author

CXF and JAXB binding for a class/property with special character in its name?

Jimi Svedenholm
Ranch Hand

Joined: May 19, 2001
Posts: 53
Hi,

I'm using the cxf-codegen-plugin for Maven to generate java classes for from a WSDL, for a web service. The problem is that the classes(types?) and properties have swedish names, and some names contains 'å', 'ä' or 'ö'. For example the name "fält", meaning "field". So with default configuration CXF and JAXB generates the file "FäLt.java" etc. Also, notice the capital L, it isn't part of the WSDL, maybe a bug in CXF/JAXB causes it. Any way, I would prefer not having java classes with these characters in them so I tried to use a JAXB binding file to bind all the swedish names to english names. Names that doesn't contain åäö works just fine. For example the class/type "rad" ("row") I now can map to Row.java. But I can't make JAXB map "fält" to "Field.java". It just says:

Thrown by JAXB: SCD "~tns:fΣlt" didnt match any schema component

Notice that I didn't type the 'Σ' in the xml binding file. I typed in the 'ä' character, but either CXF/JAXB interprets the character incorrectly (even though the file and xml encoding is UTF-8), or it is just my console window (in windows xp) that can't display it correctly. I also tried using the unicode entity å I also looked at both the WSDL file and the binding file using the program SuperEdi, and it displays the 'ä' character correctly, and identifies the file as UTF-8.
I have also tried entering the capital L instead of lowercase l, with no difference.
Does anyone know how I can make CXF/JAXB rename these classes/types/properties? Maybe there is some regex/wildcard syntax I can use so I can write something like "f*lt"?

Here is my binding file:



Regards
/Jimi
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: CXF and JAXB binding for a class/property with special character in its name?
 
Similar Threads
Wsimport and jaxb binding issue
Webservice deploy problem
Is it Synchronous or Asynchronous?
Facade design pattern in web services
want to send pdf file to client from server. pdf is generated at server