wsit
  1. wsit
  2. WSIT-1641

The namespace of the SOAP 1.2 fault subcode value is not added on server side

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 2.2.1
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      With Metro 2.0.x the SOAP 1.2 fault looks like this:

       
      <S:Fault xmlns:S="http://www.w3.org/2003/05/soap-envelope">
        <S:Code>
          <S:Value>S:Sender</S:Value>
          <S:Subcode>
            <S:Value xmlns:wst="http://schemas.xmlsoap.org/ws/2005/02/trust">wst:FailedAuthentication</S:Value>
          </S:Subcode>
        </S:Code>
        <S:Reason>
          <S:Text xml:lang="de">java.security.cert.CertificateNotYetValidException</S:Text>
        </S:Reason>
      </S:Fault>
      

      With the current trunk, it looks like this:

       
      <ns4:Fault xmlns:ns4="http://www.w3.org/2003/05/soap-envelope">
        <ns4:Code>
          <ns4:Value>ns4:Sender</ns4:Value>
          <ns4:Subcode>
            <ns4:Value>wst:FailedAuthentication</ns4:Value>
          </ns4:Subcode>
        </ns4:Code>
        <ns4:Reason>
          <ns4:Text xml:lang="de">java.security.cert.CertificateNotYetValidException</ns4:Text>
        </ns4:Reason>
      </ns4:Fault>
      

      The namespace definition is missing: xmlns:wst="http://schemas.xmlsoap.org/ws/2005/02/trust"

        Activity

        Hide
        jaxbrobot added a comment -

        Thanks. Would you please attach some app or instruction to reproduce?

        Show
        jaxbrobot added a comment - Thanks. Would you please attach some app or instruction to reproduce?
        Hide
        andreasnagel added a comment -

        I created a STS (a subclass of com.sun.xml.ws.security.trust.sts.BaseSTSImpl) and registered an implementation of com.sun.xml.ws.api.security.trust.STSAuthorizationProvider as a META-INF/services.

        The method isAuthorized from the implemented STSAuthorizationProvider throws a javax.xml.ws.soap.SOAPFaultException which is created like this:

        import javax.xml.soap.SOAPConstants;
        import javax.xml.soap.SOAPException;
        import javax.xml.soap.SOAPFactory;
        import javax.xml.soap.SOAPFault;
        import javax.xml.ws.soap.SOAPFaultException;
        import com.sun.xml.ws.security.trust.WSTrustSOAPFaultException;
        // more code ...
        public static SOAPFaultException createSOAPFaultException(String inpReason) throws SOAPException
        {
          SOAPFactory tmpFactory = SOAPFactory.newInstance(SOAPConstants.SOAP_1_2_PROTOCOL);
          SOAPFault tmpSOAPFault = null;
          if (inpReason != null)
          {
            tmpSOAPFault = tmpFactory.createFault(inpReason, SOAPConstants.SOAP_SENDER_FAULT);
          }
          else
          {
            tmpSOAPFault = tmpFactory.createFault();
            tmpSOAPFault.setFaultCode(SOAPConstants.SOAP_SENDER_FAULT);
          }
          tmpSOAPFault.appendFaultSubcode(WSTrustSOAPFaultException.WS_TRUST_FAILED_AUTHENTICATION_FAULT);
        
          SOAPFaultException tmpSoapFaultException = new SOAPFaultException(tmpSOAPFault);
          return tmpSoapFaultException;
        }
        
        Show
        andreasnagel added a comment - I created a STS (a subclass of com.sun.xml.ws.security.trust.sts.BaseSTSImpl) and registered an implementation of com.sun.xml.ws.api.security.trust.STSAuthorizationProvider as a META-INF/services. The method isAuthorized from the implemented STSAuthorizationProvider throws a javax.xml.ws.soap.SOAPFaultException which is created like this: import javax.xml.soap.SOAPConstants; import javax.xml.soap.SOAPException; import javax.xml.soap.SOAPFactory; import javax.xml.soap.SOAPFault; import javax.xml.ws.soap.SOAPFaultException; import com.sun.xml.ws.security.trust.WSTrustSOAPFaultException; // more code ... public static SOAPFaultException createSOAPFaultException( String inpReason) throws SOAPException { SOAPFactory tmpFactory = SOAPFactory.newInstance(SOAPConstants.SOAP_1_2_PROTOCOL); SOAPFault tmpSOAPFault = null ; if (inpReason != null ) { tmpSOAPFault = tmpFactory.createFault(inpReason, SOAPConstants.SOAP_SENDER_FAULT); } else { tmpSOAPFault = tmpFactory.createFault(); tmpSOAPFault.setFaultCode(SOAPConstants.SOAP_SENDER_FAULT); } tmpSOAPFault.appendFaultSubcode(WSTrustSOAPFaultException.WS_TRUST_FAILED_AUTHENTICATION_FAULT); SOAPFaultException tmpSoapFaultException = new SOAPFaultException(tmpSOAPFault); return tmpSoapFaultException; }
        Hide
        symonchang added a comment -

        The missing namespace issue should be looked into, and be fixed. However, this issue is less critical on the SOAP fault message than the normal request/response. If this missing namespace will break the interoperability with other major platforms, then this issue will be fixed in this release.

        Show
        symonchang added a comment - The missing namespace issue should be looked into, and be fixed. However, this issue is less critical on the SOAP fault message than the normal request/response. If this missing namespace will break the interoperability with other major platforms, then this issue will be fixed in this release.
        Hide
        Martin Grebac added a comment -

        Are you able to reproduce the issue? It appears to be connected to jaxb NS usage, so it may happen the issue does not exist anymore?

        Show
        Martin Grebac added a comment - Are you able to reproduce the issue? It appears to be connected to jaxb NS usage, so it may happen the issue does not exist anymore?

          People

          • Assignee:
            symonchang
            Reporter:
            andreasnagel
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated: