This is a shortcoming of wsdl2py
rather than JAXB, but it's so easy to fix, using XSLT or XQuery. A quick attempt to fix this in XSLT:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsl:template match="xsd:complexType[xsd:complexContent/xsd:extension]">
<xsd:complexType>
<xsl:apply-templates select="@*" />
<xsl:apply-templates select="xsd:annotation" />
<xsd:sequence>
<xsl:variable name="typeQName" select="string(xsd:complexContent/xsd:extension/@base)" />
<xsl:variable name="typeName"><xsl:choose>
<xsl:when test="contains($typeQName, ':')">
<xsl:value-of select="substring-after($typeQName, ':')" />
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$typeQName" />
</xsl:otherwise>
</xsl:choose></xsl:variable>
<xsl:comment>Included from <xsl:value-of select="$typeQName" />):
</xsl:comment>
<xsl:apply-templates select="//xsd:complexType[@name=$typeName]/*" />
<xsl:comment>Original extension:</xsl:comment>
<xsl:apply-templates select="xsd:complexContent/xsd:extension/*" />
</xsd:sequence>
<xsl:apply-templates
select="xsd:attribute | xsd:attributeGroup | xsd:attributeGroup" />
</xsd:complexType>
</xsl:template>
<!-- General copy rule -->
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*" />
<xsl:apply-templates />
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
A couple of notes: This only works for extension, not restrictions, and uses a nested sequence which wsdl2py
may or not support (should be easy to fix).
Currently, it only supports the content model, but could be easyly to extend to copy attributes and attributeGroups.
Also, the stylesheet only works when the extended element exists in the same schema file as the base.
Good luck!