Class StAXSOAPModelBuilder
java.lang.Object
org.apache.axiom.om.impl.builder.StAXBuilder
org.apache.axiom.om.impl.builder.StAXOMBuilder
org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder
- All Implemented Interfaces:
OMXMLParserWrapper
- Direct Known Subclasses:
MTOMStAXSOAPModelBuilder
StAX based builder that produces a SOAP infoset model.
It builds SOAP specific objects such as
SOAPEnvelope, SOAPHeader,
SOAPHeaderBlock and SOAPBody.
This builder offers two different ways to handle SOAP versions:
- Either the SOAP version is specified when the builder is constructed. If the specified version doesn't match the envelope namespace of the actual message, an exception is triggered. This approach should be used when the SOAP version is known from information other than the content of the message. For example, in the HTTP case it is possible to identify the SOAP version based on the Content-Type header.
- If no SOAP version is specified, the builder will automatically detect it from the
envelope namespace. It will then build the object model using the
SOAPFactoryimplementation corresponding to that SOAP version.
SOAPFactory is retrieved either from the OMMetaFactory
specified when the builder is constructed, or if none is specified, from the default
meta factory returned by OMAbstractFactory.getMetaFactory().-
Field Summary
Fields inherited from class org.apache.axiom.om.impl.builder.StAXBuilder
_isClosed, _releaseParserOnClose, cache, charEncoding, customBuilderForPayload, customBuilders, dataHandlerReader, document, done, elementLevel, lastNode, maxDepthForCustomBuilders, omfactory, parser, parserAccessed, parserException -
Constructor Summary
ConstructorsConstructorDescriptionStAXSOAPModelBuilder(XMLStreamReader parser) Constructor.StAXSOAPModelBuilder(XMLStreamReader parser, String soapVersion) Constructor.StAXSOAPModelBuilder(XMLStreamReader parser, SOAPFactory factory, String soapVersion) Constructor.StAXSOAPModelBuilder(OMMetaFactory metaFactory, XMLStreamReader parser) Constructor.StAXSOAPModelBuilder(OMMetaFactory metaFactory, XMLStreamReader parser, String soapVersion) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected OMElementconstructNode(OMElement parent, String elementName, boolean isEnvelope) Method constructNodeprotected OMNodeMethod createDTD.protected OMNodeCreates a new OMElement using either a CustomBuilder or the default Builder mechanism.protected OMNodeMethod createOMElement.protected OMNodecreatePI()Method createPI.voidGet the document being built by this builder.Method getDocumentElement.Method getSOAPEnvelope.protected SOAPFactoryprotected voididentifySOAPVersion(String soapVersionURIFromTransport) booleanprotected voidprocessNamespaceData(OMElement node, boolean isSOAPElement) Method processNamespaceData.voidsetProcessingDetailElements(boolean value) protected voidsetSOAPEnvelope(OMElement node) Methods inherited from class org.apache.axiom.om.impl.builder.StAXOMBuilder
createComment, createPrefix, createWithCustomBuilder, getDocumentElement, isLookahead, isNamespaceURIInterning, logParserState, lookahead, next, processNamespaceData, setDoDebug, setNamespaceURIInterningMethods inherited from class org.apache.axiom.om.impl.builder.StAXBuilder
close, createOMText, discard, getAttributeCount, getAttributeName, getAttributeNamespace, getAttributePrefix, getBuilderType, getCharacterEncoding, getCharsetEncoding, getCustomBuilder, getLastNode, getName, getNamespace, getNamespaceCount, getNamespacePrefix, getNamespaceUri, getParser, getPrefix, getReaderProperty, getRegisteredContentHandler, getText, init, isCache, isClosed, isCompleted, processAttributes, registerCustomBuilder, registerCustomBuilderForPayload, registerExternalContentHandler, releaseParserOnClose, reset, setCache, setOMBuilderFactory
-
Constructor Details
-
StAXSOAPModelBuilder
Constructor.- Parameters:
parser- the parser to read the SOAP message fromsoapVersion- the namespace URI corresponding to the expected SOAP version of the message
-
StAXSOAPModelBuilder
Constructor.- Parameters:
metaFactory- the meta factory used to get the appropriateSOAPFactoryimplementationparser- the parser to read the SOAP message fromsoapVersion- the namespace URI corresponding to the expected SOAP version of the message
-
StAXSOAPModelBuilder
Constructor.- Parameters:
parser- the parser to read the SOAP message from
-
StAXSOAPModelBuilder
Constructor.- Parameters:
metaFactory- the meta factory used to get the appropriateSOAPFactoryimplementationparser- the parser to read the SOAP message from
-
StAXSOAPModelBuilder
Constructor.- Parameters:
parser- the parser to read the SOAP message fromfactory- the SOAP factory to usesoapVersion- the namespace URI corresponding to the expected SOAP version of the message
-
-
Method Details
-
identifySOAPVersion
- Parameters:
soapVersionURIFromTransport-
-
getSOAPEnvelope
Method getSOAPEnvelope.- Returns:
- Returns SOAPEnvelope.
- Throws:
OMException
-
createNextOMElement
Description copied from class:StAXOMBuilderCreates a new OMElement using either a CustomBuilder or the default Builder mechanism.- Overrides:
createNextOMElementin classStAXOMBuilder- Returns:
- TODO
-
createOMElement
Method createOMElement.- Overrides:
createOMElementin classStAXOMBuilder- Returns:
- Returns OMNode.
- Throws:
OMException
-
setSOAPEnvelope
-
constructNode
Method constructNode- Parameters:
parent-elementName-isEnvelope-
-
endElement
public void endElement()- Overrides:
endElementin classStAXOMBuilder
-
createDTD
Method createDTD. Overriding the default behaviour as a SOAPMessage should not have a DTD.- Overrides:
createDTDin classStAXOMBuilder- Returns:
- Returns OMNode.
- Throws:
OMException
-
createPI
Method createPI. Overriding the default behaviour as a SOAP Message should not have a PI.- Overrides:
createPIin classStAXOMBuilder- Returns:
- Returns OMNode.
- Throws:
OMException
-
getDocumentElement
Method getDocumentElement.- Specified by:
getDocumentElementin interfaceOMXMLParserWrapper- Overrides:
getDocumentElementin classStAXOMBuilder- Returns:
- Returns OMElement.
-
processNamespaceData
Method processNamespaceData.- Parameters:
node-isSOAPElement-
-
getEnvelopeNamespace
-
isProcessingDetailElements
public boolean isProcessingDetailElements() -
setProcessingDetailElements
public void setProcessingDetailElements(boolean value) -
getSoapMessage
-
getDocument
Description copied from interface:OMXMLParserWrapperGet the document being built by this builder.- Specified by:
getDocumentin interfaceOMXMLParserWrapper- Overrides:
getDocumentin classStAXBuilder- Returns:
- the
OMDocumentinstance
-
getSoapFactory
- Returns:
- Returns the soapFactory.
-