Class SecurableSoapMessage


  • public final class SecurableSoapMessage
    extends SOAPMessage
    • Constructor Detail

      • SecurableSoapMessage

        public SecurableSoapMessage()
      • SecurableSoapMessage

        public SecurableSoapMessage​(SOAPMessage soapMessage)
                             throws com.sun.xml.wss.XWSSecurityException
        Parameters:
        soapMessage -
        Throws:
        com.sun.xml.wss.XWSSecurityException
    • Method Detail

      • init

        public void init​(SOAPMessage soapMessage)
                  throws com.sun.xml.wss.XWSSecurityException
        Throws:
        com.sun.xml.wss.XWSSecurityException
      • getEnvelope

        public SOAPEnvelope getEnvelope()
                                 throws com.sun.xml.wss.XWSSecurityException
        Throws:
        com.sun.xml.wss.XWSSecurityException
      • findWsseSecurityHeaderBlock

        public SecurityHeader findWsseSecurityHeaderBlock​(boolean doCreate,
                                                          boolean mustUnderstand)
                                                   throws com.sun.xml.wss.XWSSecurityException
        Finds wsse:Security Header Block.
        Parameters:
        doCreate - create one if none exists
        Returns:
        wsse:Security header
        Throws:
        com.sun.xml.wss.XWSSecurityException
      • findSecurityHeader

        public SecurityHeader findSecurityHeader()
                                          throws com.sun.xml.wss.XWSSecurityException
        Finds wsse:Security Header
        Returns:
        returns null if wsse:Security header not found
        Throws:
        com.sun.xml.wss.XWSSecurityException
      • findOrCreateSecurityHeader

        public SecurityHeader findOrCreateSecurityHeader()
                                                  throws com.sun.xml.wss.XWSSecurityException
        Finds or creates wsse:Security Header
        Returns:
        wsse:Security header
        Throws:
        com.sun.xml.wss.XWSSecurityException
      • deleteSecurityHeader

        public void deleteSecurityHeader()
        Delete security header
      • resetMustUnderstandOnSecHeader

        public void resetMustUnderstandOnSecHeader()
        Make Security Header Non-MustUnderstand
      • generateSecurityHeaderException

        public void generateSecurityHeaderException​(String exceptionMessage)
                                             throws SecurityHeaderException,
                                                    com.sun.xml.wss.XWSSecurityException
        Create and initialize a SecurityHeaderException, and throw a fault based on it. The faultstring for this exception is wsse:InvalidSecurity as per section 12 on Error Handling of the wss SOAPMessageSecurity spec (draft 17). This fault stands for An error was discovered processing the wsse:Security header.
        Throws:
        SecurityHeaderException
        com.sun.xml.wss.XWSSecurityException
      • newSOAPFaultException

        public static WssSoapFaultException newSOAPFaultException​(String faultstring,
                                                                  Throwable th)
        Create and initialize a WssSoapFaultException. This method is used in conjunction with generateClientFault.
      • newSOAPFaultException

        public static WssSoapFaultException newSOAPFaultException​(QName faultCode,
                                                                  String faultstring,
                                                                  Throwable th)
        Create and initialize a WssSoapFaultException. This method is used in conjunction with generateClientFault.
      • generateFault

        public void generateFault​(WssSoapFaultException sfe)
                           throws com.sun.xml.wss.XWSSecurityException
        Parameters:
        sfe -
        Throws:
        com.sun.xml.wss.XWSSecurityException
      • setSOAPMessage

        public void setSOAPMessage​(SOAPMessage soapMsg)
                            throws com.sun.xml.wss.XWSSecurityException
        Throws:
        com.sun.xml.wss.XWSSecurityException
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • getNamespaceContext

        public NamespaceContext getNamespaceContext()
                                             throws com.sun.xml.wss.XWSSecurityException
        Throws:
        com.sun.xml.wss.XWSSecurityException
      • generateId

        public String generateId()
                          throws com.sun.xml.wss.XWSSecurityException
        Returns:
        an ID unique w.r.t this SOAPMessage
        Throws:
        com.sun.xml.wss.XWSSecurityException
      • generateWsuId

        public void generateWsuId​(Element element)
                           throws com.sun.xml.wss.XWSSecurityException
        Parameters:
        element -
        Throws:
        com.sun.xml.wss.XWSSecurityException
      • generateWsuId

        public void generateWsuId​(Element element,
                                  String id)
                           throws com.sun.xml.wss.XWSSecurityException
        Parameters:
        element -
        id - ID specified should be unique in the message.
        Throws:
        com.sun.xml.wss.XWSSecurityException
      • getElementByWsuId

        public SOAPElement getElementByWsuId​(String id)
                                      throws com.sun.xml.wss.XWSSecurityException
        Throws:
        com.sun.xml.wss.XWSSecurityException
      • getElementById

        public Element getElementById​(String id)
                               throws com.sun.xml.wss.XWSSecurityException
        Throws:
        com.sun.xml.wss.XWSSecurityException
      • getAttachmentPart

        public AttachmentPart getAttachmentPart​(String uri)
                                         throws com.sun.xml.wss.XWSSecurityException
        Throws:
        com.sun.xml.wss.XWSSecurityException
      • getIdFromFragmentRef

        public static String getIdFromFragmentRef​(String ref)
      • getMessageParts

        public Object getMessageParts​(Target target)
                               throws com.sun.xml.wss.XWSSecurityException
        Throws:
        com.sun.xml.wss.XWSSecurityException
      • isOptimized

        public boolean isOptimized()
      • setOptimized

        public void setOptimized​(boolean optimized)
      • setDoNotSetMU

        public void setDoNotSetMU​(boolean doNotSetMU)