使用 jaxb 解组生成的轴(包含多引用)soap 响应

发布于 2024-07-08 23:07:46 字数 256 浏览 8 评论 0原文

我正在使用一个 axis 1.4 Web 服务,该服务返回肥皂响应,我想使用 jaxb 注释将其解组到我的域对象中。 我最初的测试工作得很好,直到一些返回的消息具有 multiRef 元素。 使用 multiRef 编组的对象在我的客户端注释模型对象中显示为 null。

我的问题是 JAXB 是否支持使用 multiRef 元素解组肥皂响应? 如果是这样,怎么办? 如果没有,是否有人知道更好的方法将 axis 1.4 肥皂响应解组到我的 java 域模型中?

I'm consuming an axis 1.4 web service that returns soap responses that I want to unmarshal into my domain objects using jaxb annotations. My initial tests worked very well until some of the returned messages had multiRef elements. Objects that were marshalled using multiRef were showing up as null in my client side annotated model objects.

My question is does JAXB support unmarshalling soap responses with multiRef elements? If so, how? and if not, does anybody know of a better way to unmarshal axis 1.4 soap responses into my domain model in java?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

似最初 2024-07-15 23:07:46

对于 Web 服务,JAXB 并不单独出现,而是作为 Web 客户端框架的数据绑定部分。 所以我假设您的问题是如何使用 JAXB 作为 axis 1.4 内的数据绑定。 一般来说,我认为没有简单的方法可以实现这一点,请查看 axis-user 邮件列表中的以下线程: 将 JAXB 生成的复杂类型指定给 Axis Web 服务

如果您可以升级到使用 axis2 来使用 Web 服务,那么应该会更容易,因为 axis2 带有可插入数据绑定架构,包括集成的 jaxb 实现。

In case of web services JAXB doesn't come alone, but as data binding part of ws client framework. So I assume your question is how to use JAXB as data binding within axis 1.4. In general I think there is no easy way to achieve that, have a look at the following thread in axis-user mailing list: Specify JAXB generated complex types to Axis web service.

If you can upgrade to consume web service with axis2 then it should be much easier since axis2 comes with pluggable data binding architecture including integrated jaxb implementation.

把梦留给海 2024-07-15 23:07:46

如果 Web 服务的 Axis 端也在您的控制之下,那么也许您可以将属性 org.apache.axis.AxisEngine.PROP_DOMULTIREFS 设置为 false。 在这种情况下,Axis 不应创建 multiRef 元素。 我已经在客户端 Axis 上使用了这个属性,希望它在服务器端也能以同样的方式工作。

If the Axis side of the web service is also under you control then maybe you can set the property org.apache.axis.AxisEngine.PROP_DOMULTIREFS to false. In that case Axis shouldn't create multiRef elements. I've used this property on client side Axis, hopefully it works on server side the same way.

萌能量女王 2024-07-15 23:07:46

如果您正在处理 MultiREF,那么您可能正在使用 RPC 服务。 JAXB 适用于文档样式的 Web 服务。

为了使用 RPC 风格的服务,不要使用任何外部绑定,如 JAXB、JIBX 或

使用普通的 JAX-RPC , wsdl2java Ant 任务可用于生成存根,并指定
无绑定选项。

if you are dealing with MultiREFs , then you are probably consuming an RPC service. JAXB is suitable for Document style webservices.

In order to consume an RPC style service, do not use any external binding like JAXB, JIBX or

use plain JAX-RPC , wsdl2java Ant task is available to generate the stubs, and specify
nobinding option.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文