我正在使用Apache Axis 1.3来创建Soap Web服务。我正在使用Eclipse中的JAX-B从XSD生成Java类。
在我的XSD中,我有一个complexType,其中包含属性:
<xs:complexType name="IdentificationType">
<xs:annotation>
<xs:documentation>Basic bloc for Indentification of object without version (Customer, Third party, operation)</xs:documentation>
</xs:annotation>
<xs:simpleContent>
<xs:extension base="IdentifierType">
<xs:attribute name="Issuer" type="IssuerCodeSLN" use="required">
<xs:annotation>
<xs:documentation>Provider or manager of the identifier</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="Scheme" type="SchemeCodeSLN" use="required">
<xs:annotation>
<xs:documentation>Identifier type code</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
与此类型对应的java对象包含(@XmlAttribute)注释。 我用TypeMapping在wsdd中声明了这种类型:
*****<typeMapping xmlns:ns="http://ea.assurance.bnpparibas.com/internal/schema/mco/common/v1"
qname="ns:IdentificationType"
type="java:ws.cls.POJO.xsd.ArchiveDocumentMessages.IdentificationType"
serializer="org.apache.axis.encoding.ser.BeanSerializerFactory"
deserializer="org.apache.axis.encoding.ser.BeanDeserializerFactory"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>*****
但是在WSDL中,属性显示为一系列元素:
*<complexType name="IdentificationType">
<sequence>
<element name="issuer" nillable="true" type="xsd:string" />
<element name="scheme" nillable="true" type="xsd:string" />
<element name="value" nillable="true" type="xsd:string" />
</sequence>
</complexType>*
能帮我解决这个问题吗? 预先谢谢你,