Class SOAPRequestHandler

  • All Implemented Interfaces:
    SOAPRequestHandlerInterface

    public class SOAPRequestHandler
    extends Object
    implements SOAPRequestHandlerInterface
    This class SOAPRequestHandler is to process and secure the in-bound or out-bound SOAPMessages of the web service clients and web service providers.

    This class processes the SOAPMessages for the web services security according to the processing rules defined in OASIS web services security specification and as well as the Liberty Identity Web services security framework.

    • Constructor Detail

      • SOAPRequestHandler

        public SOAPRequestHandler()
    • Method Detail

      • validateRequest

        public Object validateRequest​(jakarta.xml.soap.SOAPMessage soapRequest,
                                      Subject subject,
                                      Map sharedState,
                                      jakarta.servlet.http.HttpServletRequest request,
                                      jakarta.servlet.http.HttpServletResponse response)
                               throws SecurityException
        Authenticates the SOAPMessage from a remote client.
        Specified by:
        validateRequest in interface SOAPRequestHandlerInterface
        Parameters:
        soapRequest - SOAPMessage that needs to be validated.
        subject - the subject that may be used by the callers to store Principals and credentials validated in the request.
        sharedState - that may be used to store any shared state information between validateRequest and
        request - the HttpServletRequest associated with this SOAP Message request.
        response - the HttpServletResponse associated with this SOAP Message response.
        Returns:
        Object the authenticated token.
        Throws:
        SecurityException - if any error occured during validation.
      • secureResponse

        public jakarta.xml.soap.SOAPMessage secureResponse​(jakarta.xml.soap.SOAPMessage soapMessage,
                                                           Map sharedState)
                                                    throws SecurityException
        Secures the SOAP Message response to the client.
        Specified by:
        secureResponse in interface SOAPRequestHandlerInterface
        Parameters:
        soapMessage - SOAP Message that needs to be secured.
        sharedState - a map for the callers to store any state information between validateRequest and secureResponse.
        Throws:
        SecurityException - if any error occurs during securing.
      • secureRequest

        public jakarta.xml.soap.SOAPMessage secureRequest​(jakarta.xml.soap.SOAPMessage soapMessage,
                                                          Subject subject,
                                                          Map sharedState)
                                                   throws SecurityException
        Secures the SOAPMessage request by adding necessary credential information.
        Specified by:
        secureRequest in interface SOAPRequestHandlerInterface
        Parameters:
        soapMessage - the SOAPMessage that needs to be secured.
        subject - the Subject of the authenticating entity.
        sharedState - Any shared state information that may be used between the secureRequest and validateResponse.
        Throws:
        SecurityException - if any failure for securing the request.
      • validateResponse

        public void validateResponse​(jakarta.xml.soap.SOAPMessage soapMessage,
                                     Map sharedState)
                              throws SecurityException
        Validates the SOAP Response from the service provider.
        Specified by:
        validateResponse in interface SOAPRequestHandlerInterface
        Parameters:
        soapMessage - the SOAPMessage that needs to be validated.
        sharedState - Any shared data that may be used between the secureRequest and validateResponse.
        Throws:
        SecurityException - if any failure occured for validating the response.
      • print

        public String print​(Node node)
        Prints a Node tree recursively.
        Specified by:
        print in interface SOAPRequestHandlerInterface
        Parameters:
        node - A DOM tree Node
        Returns:
        An xml String representation of the DOM tree.