You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Martin Fernau <ma...@cps-fernau.de> on 2021/09/07 09:17:11 UTC

Why do I get the following SOAPFaultException

Hello,

I have a big problem with CXF. It seems that CXF isn't able to proper 
recognize the response of the remote web service.
Please see the following shortened response:

---cut
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:wsa="http://www.w3.org/2005/08/addressing"
xmlns:tran="http://www.starstandards.org/webservices/2005/10/transport"
     xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
     xmlns:ns1="http://www.openapplications.org/oagis/9"
     xmlns:star="http://www.starstandard.org/STAR/5" 
xmlns:fordID="urn:ford/star/security/v1.0">
     <soapenv:Header>
         [...]
     </soapenv:Header>
     <soapenv:Body>
         <tran:ProcessMessageResponse>
             <tran:payload>
                 <tran:content id="Content">
                     [...]
                 </tran:content>
             </tran:payload>
         </tran:ProcessMessageResponse>
     </soapenv:Body>
</soapenv:Envelope>
---cut

As you can see the Body contains the "ProcessMessageResponse" with 
namespace "http://www.starstandards.org/webservices/2005/10/transport" 
but CXF throws the following exception:

---cut
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.mapException(JaxWsClientProxy.java:195)
     at 
org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:145)
     at com.sun.proxy.$Proxy56.processMessage(Unknown Source)
     at 
_test.service.manufacturer.ford.cu.FirstTestCU.sendToFord(FirstTestCU.java:959)
     at 
_test.service.manufacturer.ford.cu.FirstTestCU.start(FirstTestCU.java:201)
     at 
_test.service.manufacturer.ford.cu.FirstTestCU.main(FirstTestCU.java:1050)
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:668)
     at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:541)
     at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:441)
     at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:356)
     at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:314)
     at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:96)
     at 
org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:140)
     ... 4 more
---cut

So CXF complains about missing ProcessMessageResponse which clearly is 
there.
Do CXF have problems to recognize the inherited namespace declarations 
in the Envelope-Element so that the NS-Prefix "tran" maybe is unrelated 
for CXF?
What I'm missing here?

I'm stuck at this point...

CXF Version: 3.2.14
But this also happens with 3.3 and 3.4.


Thanks
Martin

Re: Why do I get the following SOAPFaultException

Posted by Martin Fernau <ma...@cps-fernau.de>.
Thank you for your efforts!

I now see the real problem which is a complete different direction as 
the error message originally directed me to...
I'm sorry for the time you just invested.

Between the wall of log message I now discovered the following warning:
--cut
WARN org.apache.cxf.ws.addressing.soap.MAPCodec - Failed to correlate 
message, aborting dispatch.
--cut

Now as I saw this I looked closer to the response and saw that the 
remote system indeed answered with a wrong message ID:

Request was:
--cut
[...]
<MessageID 
xmlns="http://www.w3.org/2005/08/addressing">urn:uuid:099a0d39-ff43-4440-a39e-953a4c51d08a</MessageID>
[...]
--cut

Response is:
--cut
[...]
<RelatesTo>urn:ford/star/services/v1/GUDB/ProcessCustomerInformationWebService</RelatesTo>
[...]
--cut

which really annoys me! They (the remote company) is very petty when it 
comes to the content message (die business data inside) but on their 
part they are very sloppy when it comes to standards...
Because the response do not match to the original request the CXF API 
throws away the whole content which then leads to the 
IllegalEmptyResponseException.

However - thanks again for your time.

-
Martin

Am 07.09.21 um 12:27 schrieb Mantas Gridinas:
> Do other tools consider the response to be valid XML when you
> configure them with preshared XSDs (ex. intellij's XML validator)?
> Either I am not sure where should I obtain the
> http://www.starstandards.org/webservices/2005/10/transport schema
> from, or it's different compared to what appears in
> https://schemas.liquid-technologies.com/STAR/5.3.4/?page=http___www_starstandards_org_webservices_2005_10_transport.html.
> That page does not seem to define ProcessMessageResponse.
>
> On Tue, Sep 7, 2021 at 12:17 PM Martin Fernau
> <ma...@cps-fernau.de> wrote:
>> Hello,
>>
>> I have a big problem with CXF. It seems that CXF isn't able to proper
>> recognize the response of the remote web service.
>> Please see the following shortened response:
>>
>> ---cut
>> <?xml version="1.0" encoding="UTF-8"?>
>> <soapenv:Envelope xmlns:wsa="http://www.w3.org/2005/08/addressing"
>> xmlns:tran="http://www.starstandards.org/webservices/2005/10/transport"
>>       xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
>>       xmlns:ns1="http://www.openapplications.org/oagis/9"
>>       xmlns:star="http://www.starstandard.org/STAR/5"
>> xmlns:fordID="urn:ford/star/security/v1.0">
>>       <soapenv:Header>
>>           [...]
>>       </soapenv:Header>
>>       <soapenv:Body>
>>           <tran:ProcessMessageResponse>
>>               <tran:payload>
>>                   <tran:content id="Content">
>>                       [...]
>>                   </tran:content>
>>               </tran:payload>
>>           </tran:ProcessMessageResponse>
>>       </soapenv:Body>
>> </soapenv:Envelope>
>> ---cut
>>
>> As you can see the Body contains the "ProcessMessageResponse" with
>> namespace "http://www.starstandards.org/webservices/2005/10/transport"
>> but CXF throws the following exception:
>>
>> ---cut
>> 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.mapException(JaxWsClientProxy.java:195)
>>       at
>> org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:145)
>>       at com.sun.proxy.$Proxy56.processMessage(Unknown Source)
>>       at
>> _test.service.manufacturer.ford.cu.FirstTestCU.sendToFord(FirstTestCU.java:959)
>>       at
>> _test.service.manufacturer.ford.cu.FirstTestCU.start(FirstTestCU.java:201)
>>       at
>> _test.service.manufacturer.ford.cu.FirstTestCU.main(FirstTestCU.java:1050)
>> 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:668)
>>       at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:541)
>>       at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:441)
>>       at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:356)
>>       at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:314)
>>       at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:96)
>>       at
>> org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:140)
>>       ... 4 more
>> ---cut
>>
>> So CXF complains about missing ProcessMessageResponse which clearly is
>> there.
>> Do CXF have problems to recognize the inherited namespace declarations
>> in the Envelope-Element so that the NS-Prefix "tran" maybe is unrelated
>> for CXF?
>> What I'm missing here?
>>
>> I'm stuck at this point...
>>
>> CXF Version: 3.2.14
>> But this also happens with 3.3 and 3.4.
>>
>>
>> Thanks
>> Martin
>

Re: Why do I get the following SOAPFaultException

Posted by Mantas Gridinas <mg...@gmail.com>.
Do other tools consider the response to be valid XML when you
configure them with preshared XSDs (ex. intellij's XML validator)?
Either I am not sure where should I obtain the
http://www.starstandards.org/webservices/2005/10/transport schema
from, or it's different compared to what appears in
https://schemas.liquid-technologies.com/STAR/5.3.4/?page=http___www_starstandards_org_webservices_2005_10_transport.html.
That page does not seem to define ProcessMessageResponse.

On Tue, Sep 7, 2021 at 12:17 PM Martin Fernau
<ma...@cps-fernau.de> wrote:
>
> Hello,
>
> I have a big problem with CXF. It seems that CXF isn't able to proper
> recognize the response of the remote web service.
> Please see the following shortened response:
>
> ---cut
> <?xml version="1.0" encoding="UTF-8"?>
> <soapenv:Envelope xmlns:wsa="http://www.w3.org/2005/08/addressing"
> xmlns:tran="http://www.starstandards.org/webservices/2005/10/transport"
>      xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
>      xmlns:ns1="http://www.openapplications.org/oagis/9"
>      xmlns:star="http://www.starstandard.org/STAR/5"
> xmlns:fordID="urn:ford/star/security/v1.0">
>      <soapenv:Header>
>          [...]
>      </soapenv:Header>
>      <soapenv:Body>
>          <tran:ProcessMessageResponse>
>              <tran:payload>
>                  <tran:content id="Content">
>                      [...]
>                  </tran:content>
>              </tran:payload>
>          </tran:ProcessMessageResponse>
>      </soapenv:Body>
> </soapenv:Envelope>
> ---cut
>
> As you can see the Body contains the "ProcessMessageResponse" with
> namespace "http://www.starstandards.org/webservices/2005/10/transport"
> but CXF throws the following exception:
>
> ---cut
> 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.mapException(JaxWsClientProxy.java:195)
>      at
> org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:145)
>      at com.sun.proxy.$Proxy56.processMessage(Unknown Source)
>      at
> _test.service.manufacturer.ford.cu.FirstTestCU.sendToFord(FirstTestCU.java:959)
>      at
> _test.service.manufacturer.ford.cu.FirstTestCU.start(FirstTestCU.java:201)
>      at
> _test.service.manufacturer.ford.cu.FirstTestCU.main(FirstTestCU.java:1050)
> 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:668)
>      at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:541)
>      at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:441)
>      at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:356)
>      at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:314)
>      at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:96)
>      at
> org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:140)
>      ... 4 more
> ---cut
>
> So CXF complains about missing ProcessMessageResponse which clearly is
> there.
> Do CXF have problems to recognize the inherited namespace declarations
> in the Envelope-Element so that the NS-Prefix "tran" maybe is unrelated
> for CXF?
> What I'm missing here?
>
> I'm stuck at this point...
>
> CXF Version: 3.2.14
> But this also happens with 3.3 and 3.4.
>
>
> Thanks
> Martin



-- 
// Mantas