Open nazrul074 opened 4 years ago
You can use bindings to explicitly name generated classes. Name it ResponseResponseBody
and PurchaseResponseBody
.
Otherwise I'd expect XJC to generate ResponseBody
as inner class within Response
and Purchase
respectively. So the hierarchical information should be retained when generating.
Hi @highsource,
Thanks for the response. I tried to implement your solution for the top level ResponseBody. Receiving an error message:
POM plugins change:
`
**abcdBindings.xml**
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<jaxb:bindings version="2.0" xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc" xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:inheritance="http://jaxb2-commons.dev.java.net/basic/inheritance">
Hi @nazrul074 Hope you finally found a way of renaming your generated code with binding files. If not, please let us know. I think I'll add sample project for this one to show how to configure this if anyone has the same problem one day
I have run into the same problem (I think) when upgrading from 0.14.0 to 4.0.0. I ended up with only upgrading to 2.x because then the old config and xjb for 0.14.0 worked, just a shame something happened during 3.x that seems not to be documented in migration guide.
Hi @anders-payerl-mmb Could you share code sample please ? If you're using still v2, does that mean that you stick to jaxb 2 api ?
@anders-payerl-mmb : Just a reminder that is present in migration guide
Strange, I could have sworn that I followed all the steps in the migration 100% last time I tried but this time when I tried to replicate the error it of course worked… So now I'm at 3.0.1 of jaxb-maven-plugin, will try to continue to 4.x tomorrow…
Thanks for an awesome project!
Good to hear from you that it worked now. If wiki is unclear on some parts, let me know I'll try to make it clearer.
Hi, I am trying to generate Java stub from XSDs (received from third party so cannot change that). It is working fine but when XSD has same element name for the higher order element and nested element also then it is creating duplicate class name. Implementation from my POM file `
Sample schema : `