Parsing the SOAP Body (SOAPBodyParts)
Two functions are available for getting SOAP body parts.
String[] getAllSOAPBodyParts(SimpleEvent inSoapEvent) String[] getSOAPBodyParts(SimpleEvent inSoapEvent, String name, String namespace)
The getAllSOAPBodyParts() function simply returns all SOAP body parts.
The getSOAPBodyParts() function allows you to specify which parts are of interest. Given a body part name and a namespace for a specified SOAPEvent, it returns a String array of matching SOAP body parts in serialized form. Name and namespace parameters cannot be null.
Example
Given this function:
String[] body_part= getSOAPBodyParts (soapeventin,"root",http://www.tibco.com/schemas/SoapOverHttp/Schema/Schema.xsd)
And this soapeventin event payload:
<?xml version="1.0" encoding="UTF-8"?> <message> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sch="http://www.tibco.com/schemas/SoapOverHttp/Schema/Schema.xsd" xmlns:temp="http://temp/"> <soapenv:Header/> <soapenv:Body> <sch:root> <sch:First>1</sch:First> <sch:Second>2</sch:Second> </sch:root> <sch:parent2> <sch:child1>3</sch:child1> <sch:child2>4</sch:child2> </sch:parent2> </soapenv:Body> </soapenv:Envelope>
You would get this as the SOAP body part:
body_part[0]= <?xml version="1.0" encoding="UTF-8"?> <ns0:root xmlns:ns0="http://www.tibco.com/schemas/SoapOverHttp/Schema/Schema.xsd"> <ns0:First>1</ns0:First> <ns0:Second>2</ns0:Second> </ns0:root>
Copyright © TIBCO Software Inc. All Rights Reserved.