You are viewing a plain text version of this content. The canonical link for it is here.
Posted to sandesha-dev@ws.apache.org by Paul Fremantle <pz...@gmail.com> on 2006/11/20 19:24:53 UTC

Bug in Sequence.java

Folks

We have a funny little bug in using Synapse with Sandesha2.
In package org.apache.sandesha2.wsrm.Sequence

public void toSOAPEnvelope(SOAPEnvelope envelope) {
		SOAPHeader header = envelope.getHeader();
		// in some cases this is null
		

Here is a simple patch - add these lines directly afterwards.
		if (header==null) {
			SOAPFactory factory = (SOAPFactory)envelope.getOMFactory();
			header = factory.createSOAPHeader(envelope);
		}

Here is the diff:

Index: src/org/apache/sandesha2/wsrm/Sequence.java
===================================================================
--- src/org/apache/sandesha2/wsrm/Sequence.java (revision 477241)
+++ src/org/apache/sandesha2/wsrm/Sequence.java (working copy)
@@ -147,6 +147,11 @@
        public void toSOAPEnvelope(SOAPEnvelope envelope) {
                SOAPHeader header = envelope.getHeader();

+
+               if (header==null) {
+                       SOAPFactory factory =
(SOAPFactory)envelope.getOMFactory();
+                       header = factory.createSOAPHeader(envelope);
+               }
                //detach if already exist.
                OMElement elem = header.getFirstChildWithName(new
QName(namespaceValue,
                                Sandesha2Constants.WSRM_COMMON.SEQUENCE));


Paul
-- 
Paul Fremantle
VP/Technology, WSO2 and OASIS WS-RX TC Co-chair

http://bloglines.com/blog/paulfremantle
paul@wso2.com

"Oxygenating the Web Service Platform", www.wso2.com

---------------------------------------------------------------------
To unsubscribe, e-mail: sandesha-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: sandesha-dev-help@ws.apache.org


Re: Bug in Sequence.java

Posted by Chamikara Jayalath <ch...@gmail.com>.
Applied the patch. Thanks Paul.

Chamikara


On 11/20/06, Paul Fremantle <pz...@gmail.com> wrote:
>
> Folks
>
> We have a funny little bug in using Synapse with Sandesha2.
> In package org.apache.sandesha2.wsrm.Sequence
>
> public void toSOAPEnvelope(SOAPEnvelope envelope) {
>                 SOAPHeader header = envelope.getHeader();
>                 // in some cases this is null
>
>
> Here is a simple patch - add these lines directly afterwards.
>                 if (header==null) {
>                         SOAPFactory factory =
> (SOAPFactory)envelope.getOMFactory();
>                         header = factory.createSOAPHeader(envelope);
>                 }
>
> Here is the diff:
>
> Index: src/org/apache/sandesha2/wsrm/Sequence.java
> ===================================================================
> --- src/org/apache/sandesha2/wsrm/Sequence.java (revision 477241)
> +++ src/org/apache/sandesha2/wsrm/Sequence.java (working copy)
> @@ -147,6 +147,11 @@
>         public void toSOAPEnvelope(SOAPEnvelope envelope) {
>                 SOAPHeader header = envelope.getHeader();
>
> +
> +               if (header==null) {
> +                       SOAPFactory factory =
> (SOAPFactory)envelope.getOMFactory();
> +                       header = factory.createSOAPHeader(envelope);
> +               }
>                 //detach if already exist.
>                 OMElement elem = header.getFirstChildWithName(new
> QName(namespaceValue,
>                                 Sandesha2Constants.WSRM_COMMON.SEQUENCE));
>
>
> Paul
> --
> Paul Fremantle
> VP/Technology, WSO2 and OASIS WS-RX TC Co-chair
>
> http://bloglines.com/blog/paulfremantle
> paul@wso2.com
>
> "Oxygenating the Web Service Platform", www.wso2.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: sandesha-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: sandesha-dev-help@ws.apache.org
>
>

Re: Bug in Sequence.java

Posted by Chamikara Jayalath <ch...@gmail.com>.
Applied the patch. Thanks Paul.

Chamikara


On 11/20/06, Paul Fremantle <pz...@gmail.com> wrote:
>
> Folks
>
> We have a funny little bug in using Synapse with Sandesha2.
> In package org.apache.sandesha2.wsrm.Sequence
>
> public void toSOAPEnvelope(SOAPEnvelope envelope) {
>                 SOAPHeader header = envelope.getHeader();
>                 // in some cases this is null
>
>
> Here is a simple patch - add these lines directly afterwards.
>                 if (header==null) {
>                         SOAPFactory factory =
> (SOAPFactory)envelope.getOMFactory();
>                         header = factory.createSOAPHeader(envelope);
>                 }
>
> Here is the diff:
>
> Index: src/org/apache/sandesha2/wsrm/Sequence.java
> ===================================================================
> --- src/org/apache/sandesha2/wsrm/Sequence.java (revision 477241)
> +++ src/org/apache/sandesha2/wsrm/Sequence.java (working copy)
> @@ -147,6 +147,11 @@
>         public void toSOAPEnvelope(SOAPEnvelope envelope) {
>                 SOAPHeader header = envelope.getHeader();
>
> +
> +               if (header==null) {
> +                       SOAPFactory factory =
> (SOAPFactory)envelope.getOMFactory();
> +                       header = factory.createSOAPHeader(envelope);
> +               }
>                 //detach if already exist.
>                 OMElement elem = header.getFirstChildWithName(new
> QName(namespaceValue,
>                                 Sandesha2Constants.WSRM_COMMON.SEQUENCE));
>
>
> Paul
> --
> Paul Fremantle
> VP/Technology, WSO2 and OASIS WS-RX TC Co-chair
>
> http://bloglines.com/blog/paulfremantle
> paul@wso2.com
>
> "Oxygenating the Web Service Platform", www.wso2.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: sandesha-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: sandesha-dev-help@ws.apache.org
>
>