Class InNamespaceMergeInterceptor
java.lang.Object
org.apache.cxf.phase.AbstractPhaseInterceptor<Message>
org.openehealth.ipf.commons.ihe.ws.cxf.payload.InNamespaceMergeInterceptor
- All Implemented Interfaces:
Interceptor<Message>
,PhaseInterceptor<Message>
CXF interceptor which inserts XML namespace declarations from incoming
SOAP Envelope and SOAP Body elements into the String payload.
- Author:
- Dmytro Rud
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected static void
addNamespacesFromElement
(Element elem, Map<String, String> map) Adds NS defined in the given XML element to the map.protected static String
enrichNamespaces
(Document source, String target) Copies namespace definitions from SOAP Envelope and SOAP Body elements of the given XML Document into the top-level element of the XML document represented by the given String.void
handleMessage
(Message message) Methods inherited from class org.apache.cxf.phase.AbstractPhaseInterceptor
addAfter, addAfter, addBefore, addBefore, getAdditionalInterceptors, getAfter, getBefore, getId, getPhase, handleFault, isGET, isRequestor, setAfter, setBefore
-
Constructor Details
-
InNamespaceMergeInterceptor
public InNamespaceMergeInterceptor()
-
-
Method Details
-
handleMessage
- Throws:
Fault
-
enrichNamespaces
Copies namespace definitions from SOAP Envelope and SOAP Body elements of the given XML Document into the top-level element of the XML document represented by the given String.Caller is supposed to take care of the parameters' correctness, so there is no sophisticated error handling.
- Parameters:
source
- source SOAP document as a DOM object.target
- target XML Document as String.- Returns:
- target XML document enriched with namespace declarations from the source XML document.
-
addNamespacesFromElement
Adds NS defined in the given XML element to the map.Existing map items will be overwritten, so this method should be called in the tree-descending order.
-