By default JAXWS generates the corresponding datamodel for the generated stubs and skeletons. This has some disadvantages. You cannot reuse the model with diefferent WebServices. In addition if you change the WebService you have to regenerate the model. This is bad particulalry if you manually changed the model.

But there is a solution. There is a concept of so-called binding-files.

<?xml version="1.0" encoding="UTF-8"?>
<jaxb:bindings version="1.0" xmlns:jaxb=""
    <jaxb:bindings schemaLocation="./Entity.xsd" namespace="" node="/*">
    	<jaxb:bindings scd="~e:Entity">
        	<jaxb:class ref="com.mydomain.model.Entity" />

The wsimport-utility will use the declared class Entity (e.g. generated with JAXB) if you use this switches:

wsimport -Xnocompile -b xml/bindings-file.xml -s src/main/ xml/your.wsdl

Sorry, the comment form is closed at this time.

© 2011 Softwareengineering in practise Suffusion theme by Sayontan Sinha