wsimport 产生莫名奇妙的@XmlElementRefs

如果wsimport帮你生成的class中没有firstName, lastName, middleName等正常的成员变量名,而是生成下面这样的东西:

    @XmlElementRefs({
        @XmlElementRef(name = "middle-name", type = JAXBElement.class),
        @XmlElementRef(name = "last-name", type = JAXBElement.class),       
        @XmlElementRef(name = "first-name", type = JAXBElement.class),
    })
    protected List<JAXBElement<? extends Serializable>> content;

那原因就是:  你的WSDL中使用了重复的Element Name

"It appears to be due to the same element name of PublicationReferenceType in different namespaces"

http://forums.epo.org/open-patent-services-and-publication-server-web-service/topic815.html

Leave a Comment

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.