繁体   English   中英

JAX-WS 编组错误。 SomeClassV1R5 无法转换为 SomeClass 的目标类型

[英]JAX-WS marshalling Error. SomeClassV1R5 cannot be converted into the destination type of SomeClass

我们已经从 JAX-RPC 迁移到带有 Websphere(8.5.5 服务包 13)和默认 Axis2 实现的 JAX-WS 服务。 所有服务都运行良好,但 1 个客户端在相同的操作中遇到奇怪的错误,而这些操作对其他人来说运行良好。 我们启用了 SOAP 日志并尝试使用 SOAPUI 进行相同的请求,效果很好。 下面是堆栈跟踪。 GetTransactionsV1R8RequestType没有扩展GetTransactionsRequestType

Caused by: javax.xml.ws.WebServiceException: An internal error occurred during JAX-WS marshalling. An object of type com.kk.v1.GetTransactionsV1R8RequestType cannot be converted into the destination type of com.kk.v1.GetTransactionsRequestType
    at org.apache.axis2.jaxws.ExceptionFactory.createWebServiceException(ExceptionFactory.java:173)
    at org.apache.axis2.jaxws.ExceptionFactory.makeWebServiceException(ExceptionFactory.java:70)
    at org.apache.axis2.jaxws.ExceptionFactory.makeWebServiceException(ExceptionFactory.java:118)
    at org.apache.axis2.jaxws.marshaller.impl.alt.MethodMarshallerUtils.createRequestSignatureArgs(MethodMarshallerUtils.java:482)
    at org.apache.axis2.jaxws.marshaller.impl.alt.DocLitBareMethodMarshaller.demarshalRequest(DocLitBareMethodMarshaller.java:192)
    at org.apache.axis2.jaxws.server.dispatcher.JavaBeanDispatcher.createRequestParameters(JavaBeanDispatcher.java:322)
    at org.apache.axis2.jaxws.server.dispatcher.JavaBeanDispatcher.invoke(JavaBeanDispatcher.java:102)
    at org.apache.axis2.jaxws.server.EndpointController.invoke(EndpointController.java:111)
    at org.apache.axis2.jaxws.server.JAXWSMessageReceiver.receive(JAXWSMessageReceiver.java:161)

经过一番挣扎,我能够找到根本原因。 在这种情况下,客户使用原始SOAP XML调用我们的 API,而不是HTTP XML 的请求名称为GetTransactionsV1R8RequestType并且请求已成功针对 XSD/模式进行验证。 HTTP连接中,客户端将SOAPAction属性设置为“getTransactions”,这是 API 的初始版本。 请求名称是XMLgetTransactionsV1R8RequestType预期的 SOAP 操作是“getTransactionsV1R8”。

设置正确的SOAPAction值解决了这个问题。

Another observation with this is GetTransactionsV1R8RequestType is not extending GetTransactionsRequestType but was extending GetTransactionsV1R5RequestType and if we set SOAPAction value as ' getTransactionsV1R5 ' with SOAP XML GetTransactionsV1R8RequestType , it's get getting successfully called with operation ' getTransactionsV1R5 ' as GetTransactionsV1R8RequestType can be cast to GetTransactionsV1R5RequestType .

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM