CXF 2.7.7 org.apache.cxf.interceptor.Fault:意外元素 [英] CXF 2.7.7 org.apache.cxf.interceptor.Fault: Unexpected element

查看:611
本文介绍了CXF 2.7.7 org.apache.cxf.interceptor.Fault:意外元素的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

自升级到CXF 2.7.7以来,我遇到了我无法理解的错误。进行Web服务调用时,CXF报告此异常:

I am experiencing an error I cannot understand since upgrading to CXF 2.7.7. When making a web service call CXF is reporting this exception:

org.apache.cxf.interceptor.Fault: 
Unexpected element {http://schema.myorg.com/GetReference/}ReferenceResponse found.
Expected {http://services.myorg.com/}getReferences

感觉,因为ReferenceResponse正是我期望的响应。名称getReferences似乎是指被调用的@WebMethod批注方法的名称。此方法的返回类型为ReferenceResponse。

This makes no sense, because ReferenceResponse is exactly the response I expect. The name getReferences appears to refer to the name of the @WebMethod annotated method that is being called. The return type of this method is ReferenceResponse.

我缺少什么?

推荐答案

我从来没有找到一个真正令人满意的答案,但是,当我用wsdl2cxf生成的现有客户端接口替换了现有的客户端接口时,就解决了。这还涉及从Xbeans迁移到JAXB进行封送处理,这可能与它有关。

I never found a truly satisfactory answer to this, but, it was solved when I replaced the existing client interface with one generated by wsdl2cxf. This also involved migrating from Xbeans to JAXB for marshaling, which may have had something to do with it.

但是,在此期间,在接口中添加以下注释可以防止错误。

However, in the interim adding the following annotation to the interface prevented the error.

@EndpointProperty(key = "soap.no.validate.parts", value = "true")

这篇关于CXF 2.7.7 org.apache.cxf.interceptor.Fault:意外元素的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆