Spring Web Services Framework

org.springframework.ws.soap.axiom.support
Class AxiomUtils

java.lang.Object
  extended by 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
Author:
Arjen Poutsma, Tareq Abed Rabbo
See Also:
OMNamespace, QName

Constructor Summary
AxiomUtils()
           
 
Method Summary
static void removeContents(OMContainer container)
          Removes the contents (i.e. children) of the container.
static Document toDocument(SOAPEnvelope envelope)
          Converts a given AXIOM SOAPEnvelope to a Document.
static SOAPEnvelope toEnvelope(Document document)
          Converts a given Document to an AXIOM SOAPEnvelope.
static String toLanguage(Locale locale)
          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 OMNamespace toNamespace(QName qName, 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 Detail

AxiomUtils

public AxiomUtils()
Method Detail

toNamespace

public static OMNamespace toNamespace(QName qName,
                                      OMElement resolveElement)
                               throws 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:
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(OMContainer container)
Removes the contents (i.e. children) of the container.


toDocument

public static Document toDocument(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
See Also:
org.apache.rampart.util.Axis2Util.getDocumentFromSOAPEnvelope(SOAPEnvelope, boolean)

toEnvelope

public static 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
See Also:
org.apache.rampart.util.Axis2Util.getSOAPEnvelopeFromDOMDocument(Document, boolean)

Spring Web Services Framework

Copyright © 2005-2013 The Spring Web Services Framework. All Rights Reserved.