为什么我会得到一个非法的EmptyResponseException

6psbrbz9  于 2021-08-20  发布在  Java
关注(0)|答案(0)|浏览(296)

对于我当前的项目,我需要实现一个调用远程ws的soap客户机,该远程ws发送一个空响应作为其返回。响应如下所示:

<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Header>
    <wsa:Action xmlns:wsa="http://www.w3.org/2005/08/addressing">http://www.starstandards.org/webservices/2005/10/transport/operations/ProcessMessageResponse</wsa:Action>
    <wsa:RelatesTo xmlns:wsa="http://www.w3.org/2005/08/addressing">[object Object]</wsa:RelatesTo>
  </soap:Header>
  <soap:Body>
    <m:ProcessMessageResponse xmlns:m="http://www.starstandards.org/webservices/2005/10/transport"/>
  </soap:Body>
</soap:Envelope>

不幸的是,apache cxf引发了一个异常:

javax.xml.ws.soap.SOAPFaultException: Response message did not contain proper response data. Expected: {http://www.starstandards.org/webservices/2005/10/transport}ProcessMessageResponse
at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:161)
at com.sun.proxy.$Proxy76.processMessage(Unknown Source)
[...]
Caused by: org.apache.cxf.endpoint.ClientImpl$IllegalEmptyResponseException: Response message did not contain proper response data. Expected: {http://www.starstandards.org/webservices/2005/10/transport}ProcessMessageResponse
at org.apache.cxf.endpoint.ClientImpl.processResult(ClientImpl.java:663)
at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:532)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:432)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:347)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:305)
at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:96)
at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:139)
... 3 more

对我来说,xml似乎是正确的,而cxf无法“看到”processmessageresponse。但也许我只是看了太久,我没有看到明显的问题。。。
目前使用的cxf版本:3.1.18我也在3.2.14中尝试过,但结果相同。

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题