Uploaded image for project: 'CXF'
  1. CXF
  2. CXF-7295

CXF error when parsing a SOAP 1.2 fault: Invalid QName in mapping

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 2.7.18
    • None
    • Soap Binding
    • None
    • Unknown

    Description

      When receiving the following SOAP 1.2 fault, a parsing error occurs in Soap12FaultInInterceptor when the subcode value namespace is declared on the envelope tag.If declared on the "Value" tag, no problem. This kind of soapFaults is w3c compliant (https://www.w3.org/TR/soap12-part1/#faultcodes).

      I think it's not resolved in v3+ because the Soap12FaultInInterceptor seems to handle soapFaults the same way.

      If we can't modify the soapFault on the server side, how can we get this soapFault marshalling work ?

      Examples:

      <S:Envelope xmlns:S="http://www.w3.org/2003/05/soap-envelope" 
      	xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" 
      	xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" 
      	xmlns:wst="http://schemas.xmlsoap.org/ws/2005/02/trust" 
      	xmlns:psf="http://schemas.microsoft.com/Passport/SoapServices/SOAPFault">
        <S:Body>
          <S:Fault>
            <S:Code>
      	<S:Value>S:Sender</S:Value>
      	<S:Subcode>
      	  <S:Value>wst:FailedAuthentication</S:Value>
      	</S:Subcode>
            </S:Code>
            <S:Reason>
      	<S:Text xml:lang="en-US">Authentication Failure</S:Text>
            </S:Reason>
            <S:Detail>
      	<psf:error>
      	  <psf:value>0x80048821</psf:value>
      	  <psf:internalerror>
      	    <psf:code>0x80041012</psf:code>
      	    <psf:text>The entered and stored passwords do not match.&#x000D;&#x000A;</psf:text>
      	  </psf:internalerror>
      	</psf:error>
            </S:Detail>
          </S:Fault>
        </S:Body>
      </S:Envelope>

      Stack trace:
      java.lang.RuntimeException: Invalid QName in mapping: wst:FailedAuthentication
      at org.apache.cxf.helpers.XMLUtils.getQName(XMLUtils.java:447)
      at org.apache.cxf.binding.soap.interceptor.Soap12FaultInInterceptor.unmarshalFault(Soap12FaultInInterceptor.java:88)
      at org.apache.cxf.binding.soap.interceptor.Soap12FaultInInterceptor.handleMessage(Soap12FaultInInterceptor.java:59)
      at org.apache.cxf.binding.soap.interceptor.Soap12FaultInInterceptor.handleMessage(Soap12FaultInInterceptor.java:46)
      at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:263)
      at org.apache.cxf.interceptor.AbstractFaultChainInitiatorObserver.onMessage(AbstractFaultChainInitiatorObserver.java:113)
      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:263)
      at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:799)
      at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:1627)
      at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1494)
      at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1402)
      at org.apache.cxf.io.CacheAndWriteOutputStream.postClose(CacheAndWriteOutputStream.java:47)
      at org.apache.cxf.io.CachedOutputStream.close(CachedOutputStream.java:195)
      at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56)
      at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:649)
      at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
      at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:263)
      at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:533)
      at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:463)
      at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:366)
      at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:319)
      at org.apache.cxf.ws.security.trust.STSClient.requestSecurityToken(STSClient.java:708)
      at org.apache.cxf.ws.security.trust.STSClient.requestSecurityToken(STSClient.java:584)
      at org.apache.cxf.ws.security.trust.STSClient.requestSecurityToken(STSClient.java:576)
      at net.entropysoft.eci.sharepoint.webservices.SharepointWebServices.authenticateToSharePointOnline(SharepointWebServices.java:426)

      <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:amc="urn:amc:ci">
         <soap:Body>
            <soap:Fault>
               <soap:Code>
                  <soap:Value>soap:Sender</soap:Value>
                  <soap:Subcode>
                     <soap:Value>amc:R0004</soap:Value>
                  </soap:Subcode>
               </soap:Code>
               <soap:Reason>
                  <soap:Text xml:lang="fr">blabla</soap:Text>
               </soap:Reason>
               <soap:Detail>
                  <Erreur xmlns="urn:amc:ci">
                     <MessageId>1</MessageId>
                     <Horodatage>2017-03-20T17:12:41</Horodatage>
                     <Adressage>blabla</Adressage>
                     <Message>blabla</Message>
                  </Erreur>
               </soap:Detail>
            </soap:Fault>
         </soap:Body>
      </soap:Envelope>

      Stack trace:
      java.lang.RuntimeException: Invalid QName in mapping: amc:R0004
      at org.apache.cxf.helpers.XMLUtils.getQName(XMLUtils.java:462)
      at org.apache.cxf.binding.soap.interceptor.Soap12FaultInInterceptor.unmarshalFault(Soap12FaultInInterceptor.java:118)
      at org.apache.cxf.binding.soap.interceptor.Soap12FaultInInterceptor.handleMessage(Soap12FaultInInterceptor.java:66)
      at org.apache.cxf.binding.soap.interceptor.Soap12FaultInInterceptor.handleMessage(Soap12FaultInInterceptor.java:52)
      at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:272)
      at org.apache.cxf.interceptor.AbstractFaultChainInitiatorObserver.onMessage(AbstractFaultChainInitiatorObserver.java:113)
      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:272)
      at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:849)
      at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:1642)
      at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1520)
      at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1317)
      at org.apache.cxf.io.CacheAndWriteOutputStream.postClose(CacheAndWriteOutputStream.java:56)
      at org.apache.cxf.io.CachedOutputStream.close(CachedOutputStream.java:223)
      at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56)
      at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:632)
      at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
      at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:272)
      at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:572)
      at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:481)
      at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:382)
      at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:335)
      at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:96)
      at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:136)

      PS: cloned from https://issues.apache.org/jira/browse/CXF-4181

      Attachments

        Issue Links

          Activity

            People

              dkulp Daniel Kulp
              mapperCoderZ Gilles Liotard
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated: