Class StAXSOAPModelBuilder

All Implemented Interfaces:
OMXMLParserWrapper
Direct Known Subclasses:
MTOMStAXSOAPModelBuilder

public class StAXSOAPModelBuilder extends StAXOMBuilder
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 SOAPFactory implementation corresponding to that SOAP version.
In both cases, the 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().
  • Constructor Details

    • StAXSOAPModelBuilder

      public StAXSOAPModelBuilder(XMLStreamReader parser, String soapVersion)
      Constructor.
      Parameters:
      parser - the parser to read the SOAP message from
      soapVersion - the namespace URI corresponding to the expected SOAP version of the message
    • StAXSOAPModelBuilder

      public StAXSOAPModelBuilder(OMMetaFactory metaFactory, XMLStreamReader parser, String soapVersion)
      Constructor.
      Parameters:
      metaFactory - the meta factory used to get the appropriate SOAPFactory implementation
      parser - the parser to read the SOAP message from
      soapVersion - the namespace URI corresponding to the expected SOAP version of the message
    • StAXSOAPModelBuilder

      public StAXSOAPModelBuilder(XMLStreamReader parser)
      Constructor.
      Parameters:
      parser - the parser to read the SOAP message from
    • StAXSOAPModelBuilder

      public StAXSOAPModelBuilder(OMMetaFactory metaFactory, XMLStreamReader parser)
      Constructor.
      Parameters:
      metaFactory - the meta factory used to get the appropriate SOAPFactory implementation
      parser - the parser to read the SOAP message from
    • StAXSOAPModelBuilder

      public StAXSOAPModelBuilder(XMLStreamReader parser, SOAPFactory factory, String soapVersion)
      Constructor.
      Parameters:
      parser - the parser to read the SOAP message from
      factory - the SOAP factory to use
      soapVersion - the namespace URI corresponding to the expected SOAP version of the message
  • Method Details

    • identifySOAPVersion

      protected void identifySOAPVersion(String soapVersionURIFromTransport)
      Parameters:
      soapVersionURIFromTransport -
    • getSOAPEnvelope

      public SOAPEnvelope getSOAPEnvelope() throws OMException
      Method getSOAPEnvelope.
      Returns:
      Returns SOAPEnvelope.
      Throws:
      OMException
    • createNextOMElement

      protected OMNode createNextOMElement()
      Description copied from class: StAXOMBuilder
      Creates a new OMElement using either a CustomBuilder or the default Builder mechanism.
      Overrides:
      createNextOMElement in class StAXOMBuilder
      Returns:
      TODO
    • createOMElement

      protected OMNode createOMElement() throws OMException
      Method createOMElement.
      Overrides:
      createOMElement in class StAXOMBuilder
      Returns:
      Returns OMNode.
      Throws:
      OMException
    • setSOAPEnvelope

      protected void setSOAPEnvelope(OMElement node)
    • constructNode

      protected OMElement constructNode(OMElement parent, String elementName, boolean isEnvelope)
      Method constructNode
      Parameters:
      parent -
      elementName -
      isEnvelope -
    • endElement

      public void endElement()
      Overrides:
      endElement in class StAXOMBuilder
    • createDTD

      protected OMNode createDTD() throws OMException
      Method createDTD. Overriding the default behaviour as a SOAPMessage should not have a DTD.
      Overrides:
      createDTD in class StAXOMBuilder
      Returns:
      Returns OMNode.
      Throws:
      OMException
    • createPI

      protected OMNode createPI() throws OMException
      Method createPI. Overriding the default behaviour as a SOAP Message should not have a PI.
      Overrides:
      createPI in class StAXOMBuilder
      Returns:
      Returns OMNode.
      Throws:
      OMException
    • getDocumentElement

      public OMElement getDocumentElement()
      Method getDocumentElement.
      Specified by:
      getDocumentElement in interface OMXMLParserWrapper
      Overrides:
      getDocumentElement in class StAXOMBuilder
      Returns:
      Returns OMElement.
    • processNamespaceData

      protected void processNamespaceData(OMElement node, boolean isSOAPElement)
      Method processNamespaceData.
      Parameters:
      node -
      isSOAPElement -
    • getEnvelopeNamespace

      public OMNamespace getEnvelopeNamespace()
    • isProcessingDetailElements

      public boolean isProcessingDetailElements()
    • setProcessingDetailElements

      public void setProcessingDetailElements(boolean value)
    • getSoapMessage

      public SOAPMessage getSoapMessage()
    • getDocument

      public OMDocument getDocument()
      Description copied from interface: OMXMLParserWrapper
      Get the document being built by this builder.
      Specified by:
      getDocument in interface OMXMLParserWrapper
      Overrides:
      getDocument in class StAXBuilder
      Returns:
      the OMDocument instance
    • getSoapFactory

      protected SOAPFactory getSoapFactory()
      Returns:
      Returns the soapFactory.