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
FieldsModifier and TypeFieldDescriptionSet of URIs corresponding to supported SOAP versions.Set of URIs corresponding to supported WS-Addressing specification versions. -
Method Summary
Modifier and TypeMethodDescriptionstatic ExceptionextractOutgoingException(Exchange exchange) Returns Exception object from the outgoing fault message contained in the given CXF exchange, ornull, when no exception could be extracted.static StringextractOutgoingPayload(Exchange exchange) Returns String payload of the outgoing message contained in the given CXF exchange, ornull, when no String payload could be extracted.static StringextractSoapBody(String soapEnvelope) Extracts the proper body (for example, a Query) from the SOAP envelope, both represented as Strings.static ElementgetElementNS(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
nullwhen none found
-