Web-сервис wsdl содержит следующую схему:
<xs:complexType name="DocumentSearchInfo">
<xs:sequence>
...
<xs:element minOccurs="0" name="Industries" nillable="true" type="tns:ListCondition">
<xs:annotation>
<xs:appinfo>
<DefaultValue EmitDefaultValue="false" xmlns="http://schemas.microsoft.com/2003/10/Serialization/" />
</xs:appinfo>
</xs:annotation>
</xs:element>
...
</xs:sequence>
</xs:complexType>
Этот код был создан путем добавления веб-ссылки в NetBeans 6.7:
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "DocumentSearchInfo", propOrder = {
"analysts",
"companyIDCondition",
"contributorCondition",
"countries",
"dateRange",
"documentIDCondition",
"documentPageCondition",
"industries",
"keywordCondition",
"languages",
"profileID",
"purchasedOnly",
"regions",
"researchCategories",
"researchProduct"
})
public class DocumentSearchInfo {
...
@XmlElementRef(name = "Industries", namespace = "http://somenshere", type = JAXBElement.class)
protected JAXBElement<ListCondition> industries;
...
}
, который, в свою очередь, сериализуется в
<ns2:SearchInfo>
...
<ns2:ListCondition>
<ns2:Values>
<ns3:string>1385</ns3:string>
<ns3:string>1386</ns3:string>
</ns2:Values>
</ns2:ListCondition>
...
</ns2:SearchInfo>
Я ожидаю увидеть в этом XML «Отрасли», а не «ListCondition».
У меня не было проблем с использованием этой службы в .net: и svcutil, и wsdl.exe работают нормально, независимо от используемого сериализатора, но, похоже, я упускаю что-то очевидное в сериализации в Java.
Может кто-нибудь помочь?