You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by kevin glenny <ke...@gmail.com> on 2007/09/07 12:00:10 UTC
Remove OMElement from SOAPBody
Hi all,
I am trying to remove a OMElement from the SOAPBody in my Handler and have
been unable to find any methods or approaches to do this.
I would be grateful if anybody could tell me the recommended way or ideas to
achieve this.
Many thanks,
Kevin
Re: Remove OMElement from SOAPBody
Posted by kevin glenny <ke...@gmail.com>.
Many thanks for the solution :-)
On 9/7/07, Sanka Samaranayke <ss...@gmail.com> wrote:
>
> kevin glenny wrote:
> > Hi all,
> >
> > I am trying to remove a OMElement from the SOAPBody in my Handler and
> > have been unable to find any methods or approaches to do this.
>
> try,
>
> OMElement child = soapBody.getFirstChildWithQName(new
> QName("ChildToBeRemoved"));
> child.detach();
>
> Cheers,
> Sanka
>
> >
> > I would be grateful if anybody could tell me the recommended way or
> > ideas to achieve this.
> >
> > Many thanks,
> >
> > Kevin
>
>
> --
> Sanka Samaranayake
> WSO2 Inc.
>
> http://www.bloglines.com/blog/sanka
> http://www.wso2.org/
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>
Re: Remove OMElement from SOAPBody
Posted by Sanka Samaranayke <ss...@gmail.com>.
kevin glenny wrote:
> Hi all,
>
> I am trying to remove a OMElement from the SOAPBody in my Handler and
> have been unable to find any methods or approaches to do this.
try,
OMElement child = soapBody.getFirstChildWithQName(new QName("ChildToBeRemoved"));
child.detach();
Cheers,
Sanka
>
> I would be grateful if anybody could tell me the recommended way or
> ideas to achieve this.
>
> Many thanks,
>
> Kevin
--
Sanka Samaranayake
WSO2 Inc.
http://www.bloglines.com/blog/sanka
http://www.wso2.org/
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org
Re: Remove OMElement from SOAPBody
Posted by Eran Chinthaka <ch...@opensource.lk>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
barElement.detach();
kevin glenny wrote:
> To calrify my question, I am using Axis2 and AXIOM and want to remove
> the OMElement from the SOAPBody . What is the best method to take?
>
> My code code is as follows:
>
> SOAPEnvelope envelope = msgContext.getEnvelope ();
> SOAPBody body = envelope.getBody();
>
> Iterator iterator = body.getChildrenWithName(new
> QName("http://foo.org/", "Foo"));
>
> while (iterator.hasNext()) {
> OMElement fooElement = (OMElement) iterator.next();
> OMElement barElement = fooElement.getFirstChildWithName(new
> QName("http://foo.org/", "Bar"));
>
> // to do - remove barElement from the SOAPBody
>
> Thanks
>
> On 9/7/07, *kevin glenny* < kevinglenny@gmail.com
> <ma...@gmail.com>> wrote:
>
> Hi all,
>
> I am trying to remove a OMElement from the SOAPBody in my Handler
> and have been unable to find any methods or approaches to do this.
>
> I would be grateful if anybody could tell me the recommended way or
> ideas to achieve this.
>
> Many thanks,
>
> Kevin
>
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFG4fVCjON2uBzUhh8RAouSAJ44j0TuDf5urJtXAdKKgqrEF4JVlwCeMVX0
KkTPfJzUfLRgquBnSc9fB2c=
=IJ+m
-----END PGP SIGNATURE-----
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org
Re: Remove OMElement from SOAPBody
Posted by kevin glenny <ke...@gmail.com>.
To calrify my question, I am using Axis2 and AXIOM and want to remove the
OMElement from the SOAPBody . What is the best method to take?
My code code is as follows:
SOAPEnvelope envelope = msgContext.getEnvelope();
SOAPBody body = envelope.getBody();
Iterator iterator = body.getChildrenWithName(new QName("http://foo.org/",
"Foo"));
while (iterator.hasNext()) {
OMElement fooElement = (OMElement) iterator.next();
OMElement barElement = fooElement.getFirstChildWithName(new QName("
http://foo.org/", "Bar"));
// to do - remove barElement from the SOAPBody
Thanks
On 9/7/07, kevin glenny <ke...@gmail.com> wrote:
>
> Hi all,
>
> I am trying to remove a OMElement from the SOAPBody in my Handler and have
> been unable to find any methods or approaches to do this.
>
> I would be grateful if anybody could tell me the recommended way or ideas
> to achieve this.
>
> Many thanks,
>
> Kevin
>