java将对象转换为JAXBElement<Object>
我正在尝试使用一个webservice,我需要使用元素类型“JAXBElement”来设置请求的参数。我有这个特定的对象,但我不知道如何将我的对象转换为JAXBElement。我搜索了一些相关的主题,但没有找到任何明确的答案。我需要做什么来转换这个对象
你可以在下面搜索框中键入要查询的问题!
我正在尝试使用一个webservice,我需要使用元素类型“JAXBElement”来设置请求的参数。我有这个特定的对象,但我不知道如何将我的对象转换为JAXBElement。我搜索了一些相关的主题,但没有找到任何明确的答案。我需要做什么来转换这个对象
# 1 楼答案
XMLGenerator。类包含以下代码
JAXBClass。课堂
用JAXBClass中的变量映射输入类,就可以用XML编写它了
在Eclipse中,您不必编写上述类,只需右键单击xsd文件并单击generate->;JAXB类并且您拥有所需的一切
我希望这有帮助