Package com.adobe.xfa.soap
Class SOAP
- java.lang.Object
-
- com.adobe.xfa.soap.SOAP
-
public class SOAP extends java.lang.Object
SOAP
is the class which allows sending and receiving of soap messages.
-
-
Field Summary
Fields Modifier and Type Field Description static int
SOAP_BODY
static int
SOAP_ENVELOPE
static int
SOAP_FAULT
static int
SOAP_HEADER
static int
SOAP_UNKNOWN
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static SOAP
createFromXMLStreams(java.io.InputStream headerStream, java.io.InputStream bodyStream, java.lang.String loadOptions)
Creates a Soap model from a header stream and a body stream.static boolean
exportContentsToXML(Element element, java.io.OutputStream outputStream)
Export the contents of a SOAP node (and its descendants) to XML.Element
getBodyNode()
Gets the element which is the SOAP:Body elementElement
getEnvelopeNode()
Gets the element which is the Envelope elementNode
getFaultActor()
Return the fault actor node.java.lang.String
getFaultCode()
Return the fault code string (value of faultcode element).Node
getFaultDetail()
Return the fault detail string (value of faultdetail element).Element
getFaultNode()
Return the SOAP fault node.java.lang.String
getFaultString()
Return the fault string (value of faultstring element).Element
getHeaderNode()
Gets the element which is the SOAP:Header elementjava.lang.String
getLastError()
Get an error string from the last operation.static int
getNodeType(Node node)
Return the SOAP type of a given DOM node.static SOAP
loadFromStream(java.io.InputStream stream, java.lang.String loadOptions)
Loads a Soap message into a model from a stream, and creates a hierarchy for it.void
saveAs(java.io.OutputStream outputStream)
Writes the soap message into a stream.SOAP
sendRequest(java.lang.String inSOAPAddress, java.lang.String inSOAPAction)
Sends a SOAP message and returns the response.
-
-
-
Field Detail
-
SOAP_UNKNOWN
public static final int SOAP_UNKNOWN
- See Also:
- Constant Field Values
-
SOAP_BODY
public static final int SOAP_BODY
- See Also:
- Constant Field Values
-
SOAP_ENVELOPE
public static final int SOAP_ENVELOPE
- See Also:
- Constant Field Values
-
SOAP_HEADER
public static final int SOAP_HEADER
- See Also:
- Constant Field Values
-
SOAP_FAULT
public static final int SOAP_FAULT
- See Also:
- Constant Field Values
-
-
Method Detail
-
createFromXMLStreams
public static SOAP createFromXMLStreams(java.io.InputStream headerStream, java.io.InputStream bodyStream, java.lang.String loadOptions)
Creates a Soap model from a header stream and a body stream.- Parameters:
headerStream
- - the stream that contains the XML data to load into the header.bodyStream
- - the stream that contains the XML data to load into the Body.loadOptions
- - (optional) loading options.- Returns:
- The created SOAPModel
-
exportContentsToXML
public static boolean exportContentsToXML(Element element, java.io.OutputStream outputStream)
Export the contents of a SOAP node (and its descendants) to XML. Note that this method is used by the test program. It's unclear whether it has any other value in the public API.- Parameters:
element
- SOAP node (element) to export.outputStream
- Output stream to receive the contents of the exported node.- Returns:
- True if the node was a valid node and successfully exported. To be exported, the node must be a SOAP header or body element.
-
getNodeType
public static final int getNodeType(Node node)
Return the SOAP type of a given DOM node.- Parameters:
node
- Node for which the type is desired.- Returns:
- One of SOAP_ENVELOPE, SOAP_HEADER, SOAP_BODY, SOAP_FAULT or SOAP_UNKNOWN, depending on the node.
-
loadFromStream
public static SOAP loadFromStream(java.io.InputStream stream, java.lang.String loadOptions)
Loads a Soap message into a model from a stream, and creates a hierarchy for it.- Parameters:
stream
- - the stream that contains the data to load.loadOptions
- - (optional) loading options.- Returns:
- The created SOAPModel
-
getBodyNode
public Element getBodyNode()
Gets the element which is the SOAP:Body element- Returns:
- the SOAP:Body element.
-
getEnvelopeNode
public Element getEnvelopeNode()
Gets the element which is the Envelope element- Returns:
- the SOAP:Envelope element.
-
getFaultActor
public Node getFaultActor()
Return the fault actor node.- Returns:
- The faultactor element from the SOAP operation; null if no fault actor.
-
getFaultCode
public java.lang.String getFaultCode()
Return the fault code string (value of faultcode element).- Returns:
- The fault code from the SOAP operation; null if no fault code.
-
getFaultDetail
public Node getFaultDetail()
Return the fault detail string (value of faultdetail element).- Returns:
- The fault detail from the SOAP operation; null if no fault detail.
-
getFaultNode
public Element getFaultNode()
Return the SOAP fault node.- Returns:
- The fault element from the SOAP operation; null if no fault element.
-
getFaultString
public java.lang.String getFaultString()
Return the fault string (value of faultstring element).- Returns:
- The fault string from the SOAP operation; null if no fault string.
-
getHeaderNode
public Element getHeaderNode()
Gets the element which is the SOAP:Header element- Returns:
- the SOAP:Header element.
-
getLastError
public java.lang.String getLastError()
Get an error string from the last operation.- Returns:
- Error string from the last operation; null if that operation succeeded.
-
saveAs
public void saveAs(java.io.OutputStream outputStream)
Writes the soap message into a stream.- Parameters:
outputStream
- - the stream to which the message will be written.
-
sendRequest
public SOAP sendRequest(java.lang.String inSOAPAddress, java.lang.String inSOAPAction)
Sends a SOAP message and returns the response.- Parameters:
inSOAPAddress
- The HTTP address where this SOAP message will be sent.inSOAPAction
- The SOAP Action.- Returns:
- SOAPModel which is the response. If the message failed, this will contain the SOAP fault element
-
-