On Wed, Sep 23, 2009 at 8:17 PM, Asma Maalej <amaa...@laas.fr> wrote:

> Hello
>
> Using Axis2.1.4.1, and in order to recover methods name of a web service
> within a handler code, I tried to access to the SOAP message and extract it
> from the SOAPBody. Then, I tried to use "SOAPBodyElement" Class
> as shown below :
> *****
> SOAPEnvelope soapenv = messageContext.getEnvelope();
> SOAPBodyElement  soapb = (SOAPBodyElement) soapenv.getFirstElement();
>

use soapenv.getBody().getFirstElement()

thanks,
Amila.


String methodname = soapb.getLocalName();
> ************
>
> but when I invoke the web service to which I engaged the module that
> contains the above-mentioned handler, an exception launch :
> ****
> org.apache.axiom.soap.impl.llom.soap12.SOAP12HeaderImpl cannot be cast to
> org.apache.axiom.soap.impl.llom.SOAPBodyElement ****
>
> and when I tried to convert "SOAPBodyElement" to "SOAPBodyImpl" it launch
> the same exception but this time
>
> ****
> org.apache.axiom.soap.impl.llom.soap12.SOAP12HeaderImpl cannot be cast to
> org.apache.axiom.soap.impl.llom.SOAPBodyImpl
> ****
> If you have any idea, don't hesitate to help me with, please
>
> thanks
>
> --
> Asma MĀALEJ BESBES
> Laboratoire LAAS - CNRS
> Toulouse - France
> Tčl: +33 (0)5 61 33 62 63
> Mobile: +33 (0)6 72 18 36 56
> E-mail: amaa...@laas.fr
>
>


-- 
Amila Suriarachchi
WSO2 Inc.
blog: http://amilachinthaka.blogspot.com/

Reply via email to