views:

76

answers:

1

I'm using Apache CXF's wsdl2java utility to create some JAXB objects and some web service code. The schema in my WSDL has a lot of namespaces with version numbers on the end. For example:

http://example.org/sample/namespace/1.0

When CXF generates my JAXB objects the packages wind up with package names like this:

org.example.sample.namespace.1_0

Since this is a large schema with many different namespaces I have to spend quite a bit of time either re-factoring code, or using the -p option to manually map the namespaces to package names. Both processes are very time consuming.

So, I'm wondering if anyone knows if there is an easier route. Or am I being too fussy and I should just accept the package names as is?

A: 

Looks like a bunch of -p flags is probably the quickest way to map namespaces to package names. In my research I've also found that you can achieve this by using the -b option to pass in a JAXB binding file (I'm a little new to JAXB). This is also a good solution but requires a little more effort than using a bunch of -p flags. Also, the JAXB binding file is probably better in the long run, so you can repeat the process if necessary.

sisslack