Parsing (and Optionally Removing) Headers and Header Attributes
String[] getHeaders(SimpleEvent inSoapEvent, String actor, Boolean removeHeaders)
If the actor parameter has a null value then all the immediate children of the Header element are retrieved:
getHeaders(inSoapEvent,null,false)
Otherwise, the header specified by the actor attribute is retrieved. For example, given this Headers element in a SOAP event payload:
<soapenv:Header> <t:user xmlns:t="http://schemas/xml.com" soapenv:mustUnderstand="true" soapenv:actor="http://localhost:9090/Service">jon</t:user> <t:user_surname xmlns:t="http://schemas/xml.com" soapenv:mustUnderstand="true" soapenv:actor="http://localhost:9090">smith</t:user_surname> </soapenv:Header>
If you specify the following:
getHeaders(inSoapEvent,"http://localhost:9090/Service",false)
To remove the specified header part or parts, set the final parameter to true. (The SOAP specification states that if a header is processed it should be removed. You would remove a header if TIBCO BusinessEvents is acting as an intermediary node and the request created using the SOAP functions will be sent on to another server.)
Then the first Headers element is returned:
<t:user xmlns:t="http://schemas/xml.com" soapenv:mustUnderstand="true" soapenv:actor="http://localhost:9090/Service">jon</t:user>
You can also retrieve the attributes of a SOAP Header element:
String[] getSOAPHeaderAttribute(SimpleEvent inSoapEvent, int index, String attribute)
You can also remove all or selected headers using one of these functions:
removeHeaderPart() removeHeaderParts()