我有xsd:
<xs:complexType name="AppService1ResponseType">
<xs:complexContent>
<xs:extension base="AppResponseType">
<xs:sequence minOccurs="0">
<xs:element name="Person" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="Element1" type="xs:string" nillable="true"
minOccurs="0" /> ....
在AppService1ResponseType
内生成静态类
public static class Osoba
implements Serializable
和binding.xml
:
<jaxb:bindings node="//xs:complexType[@name='AppService1ResponseType']/xs:complexContent/xs:extension/xs:sequence/xs:element[@name='Person']">
<inheritance:implements>com.app.PersonI</inheritance:implements>
</jaxb:bindings>
应实现与此生成类的接口。我也尝试了另一个XPath或只是element[@name='Person']
,但没有成功。当我尝试另一个非静态类(例如AppService1ResponseType)时,继承工作正常。有一些解决方法如何解决此问题?
答案 0 :(得分:1)
好。我发现xpath中出现错误,错误应以/xs:complexType
因此绑定中正确的xpath是:
<jaxb:bindings node="//xs:complexType[@name='AppService1ResponseType']/xs:complexContent/xs:extension/xs:sequence/xs:element[@name='Person']/xs:complexType">
<inheritance:implements>com.app.PersonI</inheritance:implements>
</jaxb:bindings>