Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.1.2
-
None
-
Windows XP 64-bit, Java JDK 1.5. update 14 (32-bit)
Description
I'm using CXF as a WS client for WS which is running on JBoss 4.2.3 GA. Web service is configured to use SOAP 1.2 protocol.
Here is the SOAP message that I get from server:
<env:Envelope xmlns:env='http://www.w3.org/2003/05/soap-envelope'><env:Header></env:Header><env:Body><env:Fault xmlns:env='http://www.w3.org/2003/05/soap-envelope'><env:Code xmlns:env='http://www.w3.org/2003/05/soap-envelope'><env:Value xmlns:codeNS='http://www.w3.org/2003/05/soap-envelope' xmlns:env='http://www.w3.org/2003/05/soap-envelope'>codeNS:Receiver</env:Value></env:Code><env:Reason xmlns:env='http://www.w3.org/2003/05/soap-envelope'><env:Text xml:lang='en-US' xmlns:env='http://www.w3.org/2003/05/soap-envelope'>Some Reason</env:Text></env:Reason><env:Detail xmlns:env='http://www.w3.org/2003/05/soap-envelope'><Error><ErrorType>General</ErrorType><ErrorCode>201</ErrorCode><ErrorMessage>Person with that pid already exists!</ErrorMessage><ErrorSource>Create</ErrorSource></Error></env:Detail></env:Fault></env:Body></env:Envelope>.
CXF stack trace:
INFO: Interceptor has thrown exception, unwinding now
java.lang.RuntimeException: Invalid QName in mapping: codeNS:Receiver
at org.apache.cxf.helpers.XMLUtils.getQName(XMLUtils.java:387)
at org.apache.cxf.binding.soap.interceptor.Soap12FaultInInterceptor.handleMessage(Soap12FaultInInterceptor.java:72)
at org.apache.cxf.binding.soap.interceptor.Soap12FaultInInterceptor.handleMessage(Soap12FaultInInterceptor.java:46)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:220)
at org.apache.cxf.interceptor.AbstractFaultChainInitiatorObserver.onMessage(AbstractFaultChainInitiatorObserver.java:96)
at org.apache.cxf.binding.soap.interceptor.CheckFaultInterceptor.handleMessage(CheckFaultInterceptor.java:69)
at org.apache.cxf.binding.soap.interceptor.CheckFaultInterceptor.handleMessage(CheckFaultInterceptor.java:34)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:220)
at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:449)
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:2029)
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1865)
at org.apache.cxf.io.CacheAndWriteOutputStream.postClose(CacheAndWriteOutputStream.java:47)
at org.apache.cxf.io.CachedOutputStream.close(CachedOutputStream.java:170)
at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:66)
at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:593)
at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:220)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:296)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:242)
at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:178)
at $Proxy39.create(Unknown Source)
at com.prozone.poc.ejb.session.PersonWS_PersonWSPort_Client.main(PersonWS_PersonWSPort_Client.java:72)
Exception in thread "main" javax.xml.ws.WebServiceException: java.lang.RuntimeException: Invalid QName in mapping: codeNS:Receiver
at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:196)
at $Proxy39.create(Unknown Source)
at com.prozone.poc.ejb.session.PersonWS_PersonWSPort_Client.main(PersonWS_PersonWSPort_Client.java:72)
Caused by: java.lang.RuntimeException: Invalid QName in mapping: codeNS:Receiver
at org.apache.cxf.helpers.XMLUtils.getQName(XMLUtils.java:387)
at org.apache.cxf.binding.soap.interceptor.Soap12FaultInInterceptor.handleMessage(Soap12FaultInInterceptor.java:72)
at org.apache.cxf.binding.soap.interceptor.Soap12FaultInInterceptor.handleMessage(Soap12FaultInInterceptor.java:46)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:220)
at org.apache.cxf.interceptor.AbstractFaultChainInitiatorObserver.onMessage(AbstractFaultChainInitiatorObserver.java:96)
at org.apache.cxf.binding.soap.interceptor.CheckFaultInterceptor.handleMessage(CheckFaultInterceptor.java:69)
at org.apache.cxf.binding.soap.interceptor.CheckFaultInterceptor.handleMessage(CheckFaultInterceptor.java:34)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:220)
at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:449)
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:2029)
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1865)
at org.apache.cxf.io.CacheAndWriteOutputStream.postClose(CacheAndWriteOutputStream.java:47)
at org.apache.cxf.io.CachedOutputStream.close(CachedOutputStream.java:170)
at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:66)
at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:593)
at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:220)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:296)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:242)
at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:178)
... 2 more
I have tried to use Axis2 to test this case and everything worked ok. After looking at the CXF source code, I have noticed that the problem is in FaultCode/Value parsing. It seems like CXF soap fault 1.2 interceptor, looks for "codeNS" namespace definition only in the top element of the message (Envelope).