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

Namespace Prefix for Subcode Value is ignored

    XMLWordPrintableJSON

Details

    • Moderate

    Description

      From an InInterceptor, I'm throwing a custom (WS-Security related) SoapFault:

      SoapFault fault = new SoapFault("An error was discovered processing the <wsse:Security> header: No wsse:Security-element found",
                  SOAPConstants.SOAP_SENDER_FAULT);        fault.setSubCode(new QName("http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd", "InvalidSecurity", "wsse"));
      throw fault;
      

      My expectation is that a fault such as this is generated:

      <soap:Fault>
               <soap:Code>
                  <soap:Value>soap:Sender</soap:Value>
                  <soap:Subcode>
                     <soap:Value xmlns:*wsse*="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">*wsse*:InvalidSecurity</soap:Value>
                  </soap:Subcode>
               </soap:Code>
               <soap:Reason>
                  <soap:Text xml:lang="en">An error was discovered processing the &lt;wsse:Security> header: No wsse:Security-element found</soap:Text>
               </soap:Reason>
            </soap:Fault>
      

      However, a default namespace prefix is chosen:

      <soap:Fault>
               <soap:Code>
                  <soap:Value>soap:Sender</soap:Value>
                  <soap:Subcode>
                     <soap:Value xmlns:*ns1*="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">*ns1*:InvalidSecurity</soap:Value>
                  </soap:Subcode>
               </soap:Code>
               <soap:Reason>
                  <soap:Text xml:lang="en">An error was discovered processing the &lt;wsse:Security> header: No wsse:Security-element found</soap:Text>
               </soap:Reason>
            </soap:Fault>
      

      The prefix information is lost somewhere.

      Attachments

        Activity

          People

            dkulp Daniel Kulp
            Davio Dave Franken
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: