Class SOAPHeadersAdapter

  • All Implemented Interfaces:
    Map<QName,​List<String>>

    public class SOAPHeadersAdapter
    extends Object
    implements Map<QName,​List<String>>
    The JAX-WS exposes soap header properties whose value is Map>. The QName is the name of the header and List are the xml values of the headers for qname. The JAX-WS MessageContext stores soap headers in an Axiom tree object located on the JAX-WS Message. This class, SOAPHeadersAdapter, is an adapter between the Map> interface needed by the properties and the actual implementation. All useful function is delegated through the MessageContext, so that we only have one copy of the soap header information. To use this class, invoke the install method. This will create an SOAPHeaderAdapter (if necessary) and install it on to provide the JAX-WS soap headers property. (See BaseMessageContext.)
    • Method Detail

      • install

        public static void install​(MessageContext mc)
        Add the AttachmentAdapter as the property for the inbound and/or outbound attachment property
        Parameters:
        mc - MessageContext
      • get

        public List<String> get​(Object _key)
        Returns a list of XML strings that have the same namespace as the QName key. The returned list is not "live"; it manipulating the list will not result in changed headers on the message.
        Specified by:
        get in interface Map<QName,​List<String>>
        Parameters:
        _key - Object -- QName key of header XML strings you intend to retrieve
      • put

        public List<String> put​(QName key,
                                List<String> values)
        put will inject the headers into the SOAP message immediately
        Specified by:
        put in interface Map<QName,​List<String>>
        Parameters:
        key - Object -- QName key of header XML strings you wish to be put on the SOAP header
        values - List -- list of XML strings that have the same namespace as the QName key
      • putAll

        public void putAll​(Map<? extends QName,​? extends List<String>> t)
        putAll will inject the headers into the SOAP message immediately
        Specified by:
        putAll in interface Map<QName,​List<String>>
      • remove

        public List<String> remove​(Object _key)
        remove will immediately remove the headers from the SOAP message that match the QName key
        Specified by:
        remove in interface Map<QName,​List<String>>
        Parameters:
        _key - Object -- QName key of header XML strings you wish to remove from the SOAP header