Thanks David. I'll look through the archives - but I'd definitely like
to see this fixed unless there's a really compelling reason not to do
so. I'll write again after a quick read. :)
If we want to have an interface that adds a generic OMElement to
SOAPHeader, that's fine... but it's a convenience method which wraps the
OMElement in a SOAPHeaderBlock. From the model/API perspective, the
only thing that should live in SOAPHeader are SOAPHeaderBlocks.
--Glen
David Illsley wrote:
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]