Unmarshalling Error: unexpected element (uri:url, local:“objectname”). Expected elements are <{}objectname>

后端 未结 5 1433
梦谈多话
梦谈多话 2021-02-14 19:33

I\'m using jaxb2-marshaller to generate classes to communicate with a webservice. Java-classes are generated with use of some wsdl files.

Everything is okay now, but whe

5条回答
  •  栀梦
    栀梦 (楼主)
    2021-02-14 20:00

    • Either your original schema does not have the right target namespace.
    • Or you're somehow missing the package-info.java

    Please post your ObjectFactory and package-info.java (must be generated next to the ObjectFactory).

    You actually don't have to create your instances via ObjectFactory, normal new constructions work fine. :) ObjectFactory does no magic. It is primarily used by JAXB during unmarshalling.

    ps. Please tag the maven-jaxb2-plugin-related questions with the maven-jaxb2-plugin tag - this will get my attention quicker.

提交回复
热议问题