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="http://java.sun.com/xml/ns/jaxb"
    xmlns:ext="http://java.sun.com/xml/ns/jaxb/xjc"
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
    xmlns:e="http://www.mydomain.com/Entity">
    <jaxb:bindings schemaLocation="./Entity.xsd" namespace="http://www.mydomain.com/Entity" node="/*">
    	<jaxb:bindings scd="~e:Entity">
        	<jaxb:class ref="com.mydomain.model.Entity" />
    	</jaxb:bindings>
</jaxb:bindings>

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