Class AxiomUtils

java.lang.Object
org.springframework.ws.soap.axiom.support.AxiomUtils

public abstract class AxiomUtils extends Object
Collection of generic utility methods to work with Axiom. Includes conversion from OMNamespaces to QNames.
Since:
1.0.0
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    removeContents(org.apache.axiom.om.OMContainer container)
    Removes the contents (i.e.
    static Document
    toDocument(org.apache.axiom.soap.SOAPEnvelope envelope)
    Converts a given AXIOM SOAPEnvelope to a Document.
    static org.apache.axiom.soap.SOAPEnvelope
    toEnvelope(Document document)
    Converts a given Document to an AXIOM SOAPEnvelope.
    static String
    Converts the given locale to a xml:lang string, as used in Axiom Faults.
    static Locale
    toLocale(String language)
    Converts the given locale to a xml:lang string, as used in Axiom Faults.
    static org.apache.axiom.om.OMNamespace
    toNamespace(QName qName, org.apache.axiom.om.OMElement resolveElement)
    Converts a javax.xml.namespace.QName to a org.apache.axiom.om.OMNamespace.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • AxiomUtils

      public AxiomUtils()
  • Method Details

    • toNamespace

      public static org.apache.axiom.om.OMNamespace toNamespace(QName qName, org.apache.axiom.om.OMElement resolveElement) throws org.apache.axiom.om.OMException
      Converts a javax.xml.namespace.QName to a org.apache.axiom.om.OMNamespace. A OMElement is used to resolve the namespace, or to declare a new one.
      Parameters:
      qName - the QName to convert
      resolveElement - the element used to resolve the Q
      Returns:
      the converted SAAJ Name
      Throws:
      org.apache.axiom.om.OMException - if conversion is unsuccessful
      IllegalArgumentException - if qName is not fully qualified
    • toLanguage

      public static String toLanguage(Locale locale)
      Converts the given locale to a xml:lang string, as used in Axiom Faults.
      Parameters:
      locale - the locale
      Returns:
      the language string
    • toLocale

      public static Locale toLocale(String language)
      Converts the given locale to a xml:lang string, as used in Axiom Faults.
      Parameters:
      language - the language string
      Returns:
      the locale
    • removeContents

      public static void removeContents(org.apache.axiom.om.OMContainer container)
      Removes the contents (i.e. children) of the container.
    • toDocument

      public static Document toDocument(org.apache.axiom.soap.SOAPEnvelope envelope)
      Converts a given AXIOM SOAPEnvelope to a Document.
      Parameters:
      envelope - the SOAP envelope to be converted
      Returns:
      the converted document
      Throws:
      IllegalArgumentException - in case of errors
    • toEnvelope

      public static org.apache.axiom.soap.SOAPEnvelope toEnvelope(Document document)
      Converts a given Document to an AXIOM SOAPEnvelope.
      Parameters:
      document - the document to be converted
      Returns:
      the converted envelope
      Throws:
      IllegalArgumentException - in case of errors