jaxb 和 xlink - 朋友还是敌人?
我想通过 cxf 建立一个休息服务。 这已经只用两个对象“Earthpart”和“Earthquake”完成了。 当我调用 localhost/earthpars 时,我得到了发生地震的地球部分的 xml 列表。 但是具有更多信息{多重、多长时间等}的地震对象只能通过指向 localhost/earthquake/{id} 的 xlink 获得 简短地说:在 localhost/earthpars 中只有 localhost/earthquake/{id} 的 xlink。
现在是技术部分: 老实说,请求是使用camel-cxf和jaxb来构建REST服务。使用 jaxb 构建 xlinks 可以使用命名空间,但这显然不是正确的方法!所以问题是:是否有任何关于 xlink 与 jaxb 相关的信息,或者这不是 xlinks 的方法?
i want to build a rest service via cxf.
this is already done with only two objects "Earthpart" and "Earthquake".
when i call localhost/earthpars i get a xml list of the earthparts with the earthquakes.
but the earthquakeobject with more information {how heavy, how long, etc.} is only available with a xlink to localhost/earthquake/{id}
shortly: In localhost/earthpars is only the xlink to localhost/earthquake/{id}.
now the technical part:
to be honest the request was to use camel-cxf and jaxb to build a REST service. building xlinks with jaxb is possible with namespaces but thats obviously not the way to go! so the question is: is there any info about xlink in connection with jaxb anywhere or is that not the way to go for xlinks?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用 XmlAdapter 将子对象转换为 xlink 表示形式。有关 XmlAdapter 的详细信息,请参阅:
You could use an XmlAdapter to convert the child object to an xlink representation. For more information on XmlAdapter see: