Class SoapUtils
java.lang.Object
org.openehealth.ipf.commons.ihe.ws.utils.SoapUtils
Generic constants and subroutines for SOAP/XML processing.
- Author:
- Dmytro Rud
-
Field Summary
Modifier and TypeFieldDescriptionSet of URIs corresponding to supported SOAP versions.Set of URIs corresponding to supported WS-Addressing specification versions. -
Method Summary
Modifier and TypeMethodDescriptionstatic Exception
extractOutgoingException
(Exchange exchange) Returns Exception object from the outgoing fault message contained in the given CXF exchange, ornull
, when no exception could be extracted.static String
extractOutgoingPayload
(Exchange exchange) Returns String payload of the outgoing message contained in the given CXF exchange, ornull
, when no String payload could be extracted.static String
extractSoapBody
(String soapEnvelope) Extracts the proper body (for example, a Query) from the SOAP envelope, both represented as Strings.static Element
getElementNS
(Element root, Set<String> nsUris, String wantedLocalName) Searches for the first sub-element of the given XML element, which has the given local name and whose namespace belongs to the given set.
-
Field Details
-
WS_ADDRESSING_NS_URIS
Set of URIs corresponding to supported WS-Addressing specification versions. -
SOAP_NS_URIS
Set of URIs corresponding to supported SOAP versions.
-
-
Method Details
-
extractSoapBody
Extracts the proper body (for example, a Query) from the SOAP envelope, both represented as Strings.Does really suppose that the given String contains a SOAP envelope and not check it thoroughly.
- Parameters:
soapEnvelope
- The SOAP Envelope (XML document) as String.- Returns:
- Extracted SOAP Body contents as String, or the original parameter when it does not seem to represent a valid SOAP envelope.
-
extractOutgoingException
Returns Exception object from the outgoing fault message contained in the given CXF exchange, ornull
, when no exception could be extracted. -
extractOutgoingPayload
Returns String payload of the outgoing message contained in the given CXF exchange, ornull
, when no String payload could be extracted. -
getElementNS
Searches for the first sub-element of the given XML element, which has the given local name and whose namespace belongs to the given set.- Parameters:
root
- an XML element whose children will be iterated, null values are allowednsUris
- a set of namespace URIs the wanted element can belong towantedLocalName
- local name of the wanted element- Returns:
- corresponding child element or
null
when none found
-