org.apache.axis2.jaxws.message.util.impl
Class SAAJConverterImpl

java.lang.Object
  extended by org.apache.axis2.jaxws.message.util.impl.SAAJConverterImpl
All Implemented Interfaces:
SAAJConverter

public class SAAJConverterImpl
extends java.lang.Object
implements SAAJConverter

SAAJConverterImpl Provides an conversion methods between OM<->SAAJ


Nested Class Summary
protected  class SAAJConverterImpl.NameCreator
          A Name can be created from either a SOAPEnvelope or SOAPFactory.
 
Method Summary
protected  void addAttributes(SAAJConverterImpl.NameCreator nc, SOAPElement element, javax.xml.stream.XMLStreamReader reader)
          add attributes
protected  SOAPElement buildSOAPTree(SAAJConverterImpl.NameCreator nc, SOAPElement root, SOAPElement parent, javax.xml.stream.XMLStreamReader reader, boolean quitAtBody)
          Build SOAPTree Either the root or the parent is null.
protected  SOAPElement createElement(SOAPElement parent, QName qName)
          Create child SOAPElement
protected  SOAPElement createElementFromTag(SAAJConverterImpl.NameCreator nc, SOAPElement parent, javax.xml.stream.XMLStreamReader reader)
          Create SOAPElement from the current tag data
 MessageFactory createMessageFactory(java.lang.String namespace)
          Creates a MessageFactory that can support the SOAP version identified by the specified envelope namespace.
 org.apache.axiom.om.OMElement toOM(SOAPElement soapElement)
          Convert SOAPElement into an OMElement
 org.apache.axiom.soap.SOAPEnvelope toOM(SOAPEnvelope saajEnvelope)
          Convert SAAJ SOAPEnvelope to OM SOAPEnvelope
 SOAPElement toSAAJ(org.apache.axiom.om.OMElement omElement, SOAPElement parent)
          Convert omElement into a SOAPElement and add it to the parent SOAPElement.
 SOAPElement toSAAJ(org.apache.axiom.om.OMElement omElement, SOAPElement parent, SOAPFactory sf)
          Convert omElement into a SOAPElement and add it to the parent SOAPElement.
 SOAPEnvelope toSAAJ(org.apache.axiom.soap.SOAPEnvelope omEnvelope)
          Convert OM SOAPEnvleope to SAAJ SOAPEnvelope
protected  void updateTagData(SAAJConverterImpl.NameCreator nc, SOAPElement element, javax.xml.stream.XMLStreamReader reader, boolean newElement)
          update the tag data of the SOAPElement
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

toSAAJ

public SOAPEnvelope toSAAJ(org.apache.axiom.soap.SOAPEnvelope omEnvelope)
                    throws WebServiceException
Description copied from interface: SAAJConverter
Convert OM SOAPEnvleope to SAAJ SOAPEnvelope

Specified by:
toSAAJ in interface SAAJConverter
Returns:
SOAPEnvelope
Throws:
WebServiceException

toOM

public org.apache.axiom.soap.SOAPEnvelope toOM(SOAPEnvelope saajEnvelope)
                                        throws WebServiceException
Description copied from interface: SAAJConverter
Convert SAAJ SOAPEnvelope to OM SOAPEnvelope

Specified by:
toOM in interface SAAJConverter
Returns:
OM Envelope
Throws:
WebServiceException

toOM

public org.apache.axiom.om.OMElement toOM(SOAPElement soapElement)
                                   throws WebServiceException
Description copied from interface: SAAJConverter
Convert SOAPElement into an OMElement

Specified by:
toOM in interface SAAJConverter
Returns:
OMElement
Throws:
WebServiceException

toSAAJ

public SOAPElement toSAAJ(org.apache.axiom.om.OMElement omElement,
                          SOAPElement parent)
                   throws WebServiceException
Description copied from interface: SAAJConverter
Convert omElement into a SOAPElement and add it to the parent SOAPElement. This method requires that the parent element have an ancestor that is a SOAPEnvelope. If this is not the case use the toSAAJ(OMElement, SOAPElement, SOAPFactory) method

Specified by:
toSAAJ in interface SAAJConverter
parent - SOAPElement
Returns:
SOAPElement that was added to the parent.
Throws:
WebServiceException
See Also:
SAAJConverter.toSAAJ(OMElement, SOAPElement, SOAPFactory)

toSAAJ

public SOAPElement toSAAJ(org.apache.axiom.om.OMElement omElement,
                          SOAPElement parent,
                          SOAPFactory sf)
                   throws WebServiceException
Description copied from interface: SAAJConverter
Convert omElement into a SOAPElement and add it to the parent SOAPElement.

Specified by:
toSAAJ in interface SAAJConverter
parent - SOAPElement
sf - SOAPFactory that is used to create Name objects
Returns:
SOAPElement that was added to the parent.
Throws:
WebServiceException - * @see toSAAJ(OMElement, SOAPElement)

buildSOAPTree

protected SOAPElement buildSOAPTree(SAAJConverterImpl.NameCreator nc,
                                    SOAPElement root,
                                    SOAPElement parent,
                                    javax.xml.stream.XMLStreamReader reader,
                                    boolean quitAtBody)
                             throws WebServiceException
Build SOAPTree Either the root or the parent is null. If the root is null, a new element is created under the parent using information from the reader If the parent is null, the existing root is updated with the information from the reader

Parameters:
nc - NameCreator
root - SOAPElement (the element that represents the data in the reader)
parent - (the parent of the element represented by the reader)
reader - XMLStreamReader. the first START_ELEMENT matches the root
quitAtBody - - true if quit reading after the body START_ELEMENT
Throws:
WebServiceException

createElementFromTag

protected SOAPElement createElementFromTag(SAAJConverterImpl.NameCreator nc,
                                           SOAPElement parent,
                                           javax.xml.stream.XMLStreamReader reader)
                                    throws SOAPException
Create SOAPElement from the current tag data

Parameters:
nc - NameCreator
parent - SOAPElement for the new SOAPElement
reader - XMLStreamReader whose cursor is at the START_ELEMENT
Returns:
Throws:
SOAPException

createElement

protected SOAPElement createElement(SOAPElement parent,
                                    QName qName)
                             throws SOAPException
Create child SOAPElement

Parameters:
parent - SOAPElement
name - Name
Returns:
Throws:
SOAPException

updateTagData

protected void updateTagData(SAAJConverterImpl.NameCreator nc,
                             SOAPElement element,
                             javax.xml.stream.XMLStreamReader reader,
                             boolean newElement)
                      throws SOAPException
update the tag data of the SOAPElement

Parameters:
NameCreator - nc
element - SOAPElement
reader - XMLStreamReader whose cursor is at START_ELEMENT
Throws:
SOAPException

addAttributes

protected void addAttributes(SAAJConverterImpl.NameCreator nc,
                             SOAPElement element,
                             javax.xml.stream.XMLStreamReader reader)
                      throws SOAPException
add attributes

Parameters:
NameCreator - nc
element - SOAPElement which is the target of the new attributes
reader - XMLStreamReader whose cursor is at START_ELEMENT
Throws:
SOAPException

createMessageFactory

public MessageFactory createMessageFactory(java.lang.String namespace)
                                    throws SOAPException,
                                           WebServiceException
Description copied from interface: SAAJConverter
Creates a MessageFactory that can support the SOAP version identified by the specified envelope namespace.

Specified by:
createMessageFactory in interface SAAJConverter
Returns:
Throws:
WebServiceException - if the namespace is SOAP 1.2 and the SAAJ does not support SOAP 1.2 or the namespace is unknown.
SOAPException


Copyright © 2007 Apache Web Services Project. All Rights Reserved.