Class SoapUtils
- java.lang.Object
-
- org.openehealth.ipf.commons.ihe.ws.utils.SoapUtils
-
public abstract class SoapUtils extends Object
Generic constants and subroutines for SOAP/XML processing.- Author:
- Dmytro Rud
-
-
Field Summary
Fields Modifier and Type Field Description static Set<String>SOAP_NS_URISSet of URIs corresponding to supported SOAP versions.static Set<String>WS_ADDRESSING_NS_URISSet of URIs corresponding to supported WS-Addressing specification versions.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ExceptionextractOutgoingException(org.apache.cxf.message.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(org.apache.cxf.message.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.
-
-
-
Method Detail
-
extractSoapBody
public static String extractSoapBody(String soapEnvelope)
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
public static Exception extractOutgoingException(org.apache.cxf.message.Exchange exchange)
Returns Exception object from the outgoing fault message contained in the given CXF exchange, ornull, when no exception could be extracted.
-
extractOutgoingPayload
public static String extractOutgoingPayload(org.apache.cxf.message.Exchange exchange)
Returns String payload of the outgoing message contained in the given CXF exchange, ornull, when no String payload could be extracted.
-
getElementNS
public 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.- 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
-
-