Hi Glen, I think this has been discussed before... the problem is that any handler may add an OMElement as a child of the SOAPHeader per the OMElement interface.
If this is to be fixed it's in Axiom, and I think there was some justification for not changing this when it was brought up before... but I can't remember what it was. David On 08/03/07, Glen Daniels <[EMAIL PROTECTED]> wrote:
Hi Asankha: I assume this has already been reported as an Axis2 problem? IMHO we should just fix this on the A2 side and not write this kind of bug-compatible code for Synapse..... --Glen [EMAIL PROTECTED] wrote: > Author: asankha > Date: Thu Mar 8 04:30:44 2007 > New Revision: 516022 > > URL: http://svn.apache.org/viewvc?view=rev&rev=516022 > Log: > Axis2 has a strange behaviour where some of the headers returned from getEnvelope().getHeader().examineAllHeaderBlocks() returns raw OMElements and not only SOAPHeaderBlock's - make our code resilient > > Modified: > webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/core/axis2/Axis2MessageContext.java > > Modified: webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/core/axis2/Axis2MessageContext.java > URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/core/axis2/Axis2MessageContext.java?view=diff&rev=516022&r1=516021&r2=516022 > ============================================================================== > --- webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/core/axis2/Axis2MessageContext.java (original) > +++ webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/core/axis2/Axis2MessageContext.java Thu Mar 8 04:30:44 2007 > @@ -24,6 +24,7 @@ > import org.apache.axiom.om.xpath.AXIOMXPath; > import org.apache.axiom.om.impl.llom.OMTextImpl; > import org.apache.axiom.om.impl.llom.OMElementImpl; > +import org.apache.axiom.om.OMElement; > import org.apache.axis2.AxisFault; > import org.apache.axis2.addressing.EndpointReference; > import org.apache.axis2.addressing.RelatesTo; > @@ -444,8 +445,14 @@ > if (iter.hasNext()) { > sb.append(separator + "Headers : "); > while (iter.hasNext()) { > - SOAPHeaderBlock header = (SOAPHeaderBlock) iter.next(); > - sb.append(separator + header.getLocalName() + " : " + header.getText()); > + Object o = iter.next(); > + if (o instanceof SOAPHeaderBlock) { > + SOAPHeaderBlock header = (SOAPHeaderBlock) o; > + sb.append(separator + header.getLocalName() + " : " + header.getText()); > + } else if (o instanceof OMElement) { > + OMElement headerElem = (OMElement) o; > + sb.append(separator + headerElem.getLocalName() + " : " + headerElem.getText()); > + } > } > } > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
-- David Illsley - IBM Web Services Development --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
