Back to Metro Guide

3.3. Customizing XML Schema binding

3.3.1. How to get simple and better typed binding

wsimport uses JAXB RI's XJC tool internally to achive XML Schema to Java binding. The default behaviour is strictly as per JAXB 2.x specification. However it does not work for everyone, for example if you want to map xs:anyURI to instead of java.lang.String (default mapping).

There is a JAXB global customization that can help you achieve these tasks:

simple.xjb - This enables the simple binding mode

<?xml version="1.0" encoding="UTF-8"?>
  xmlns:jaxb="" jaxb:version="2.0"
  xmlns:xjc= "" jaxb:extensionBindingPrefixes="xjc">

    <xjc:simple />

Then simply run your wsimport and pass this binding customization file

wsimport -p mypackage -keep -b simple.xjb myservice.wsdl

See Kohsuke's blog for more details.