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]