4

We just upgraded to the below Jaxb version and started noticing that it strips off the "Type" suffix when the classes are generated. This is causing issues as the schema we got from 3'rd party is now having two classes with the same name. Can someone tell us how to get around this and keep the "Type" suffix as is?

  jaxbVersion = '2.2.11'
  jaxwsVersion = '2.2.10'
  jaxwsrsVersion = '2.0.1'

Thanks

  • It appears that some "Type" suffixes can be avoided by use of ``. See http://stackoverflow.com/a/4818344/603516. – Vadzim Mar 11 '16 at 17:28

1 Answers1

1

Use the following schema bindings declaration:

<schemaBindings>
  <nameXmlTransform>
    <typeName suffix="Type"/>
  </nameXmlTransform>
</schemaBindings>

See:

lexicore
  • 39,549
  • 12
  • 108
  • 193
  • Thanks for ur comment but its an external schema and we d'not want to modify it. Is there something that I can pass in with XJC that would not remove the extension "Type" ? – user3799186 Oct 27 '15 at 16:11
  • @user3799186 Please really do read the link I've posted. You have to provide an additional binding files, you don't have to modify the schema. – lexicore Oct 27 '15 at 17:05
  • 1
    Unfortunately this solution adds suffix to generated class names instead of removing it as the question asks. I'm looking for a way to remove "Type" suffix that is hardcoded in XSD without enumerating all types one by one in the bindings. – Vadzim Mar 11 '16 at 16:27
  • @Vadzim The question asks to *keep the "Type" suffix*. Ok, it also says "as is", so not the perfect match here, but anyway this question does not ask about removing the suffix as your comment suggests. Ask another question on removing the suffix. – lexicore Mar 13 '16 at 10:48