File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Web Services and the fly likes Wsimport and jaxb binding issue Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "Wsimport and jaxb binding issue" Watch "Wsimport and jaxb binding issue" New topic

Wsimport and jaxb binding issue

Jay Olsen

Joined: Jan 26, 2008
Posts: 10

Apologies if this is a novice question, I’m new to this area. I’m using wsimport to generate java artifacts from wsdl. I got a simple wsdl from a netbeans tutorial at the following link. Using the following wsimport command, the artifacts are generated successfully.

The artifacts are created in the org.netbeans.j2ee.wsdl.creditreport which is the target namespace for the wsdl file. If I want to customize the package, I can use the following wsimport command

Running this command outputs all the java artifacts in the com.test package. However, my ultimate goal is to use a jaxb binding file to customize the wsimport output. Therefore, I created a binding file to do the package customization. That file contains the following

Then, I run the following command

For some reason, this only partially works. Some of the artifacts are generated in com.test package and more are generated in the org.netbeans.j2ee.wsdl.creditreport. Can someone explain what is wrong with my jaxb bindings file? Why does the customization not apply to all the generated artifacts?

Thanks in advance
Eric Mission

Joined: Apr 22, 2009
Posts: 22
I found this link while searching for an answer to my errors. I am a full-fledged greenhorn to Java WS's, not to mention this being my very first post, so it may not even be relevant to your needs but I thought I would try.

Kohsuke Kawaguchi's Blog: Separate compilation in the JAXB RI 2.1

Good luck.

to infinity and beyond
Jay Olsen

Joined: Jan 26, 2008
Posts: 10
Thanks for your reply. I managed to resolve the issue using a combination of both JAX-WS and JAXB binding files when using wsimport. The implementation above only used jaxb customizations which generated schema types artifacts. However, the generated artifacts for the service endpoint interface and the port accessor methods where being generated in a package structure relating to their target namespace in the wsdl. To override/customize this behavior, a JAX-WS binding file is required. This bindings file is basic, specifying the wsdl location and the package where the generated artifacts should be placed.
I agree. Here's the link:
subject: Wsimport and jaxb binding issue
It's not a secret anymore!