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 Moley Harey <mo...@gmail.com> on 2008/03/11 16:43:59 UTC

How to get the MessageContext of my application?

Hi,

I have stored some parameters in my Axis2 application services.xml file and
I would like to retrieve them, for that I use:

=====
org.apache.axis2.context.MessageContext msgCtx = new
org.apache.axis2.context.MessageContext();
Parameter parameter = msgCtx.getParameter("myParameter");
=====

The problem is that I get a NullPointerException because msgCtx is null...
How can I get the correct value of msgCtx for my application?

Thanks in advance!

-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Para atras, solo para tomar impulso!

http://chromewaves.blogspot.com/

Re: How to get the MessageContext of my application?

Posted by Thilina Gunarathne <cs...@gmail.com>.
You can use the following inside your service implementation..

MessageContext incomingContext = MessageContext.getCurrentMessageContext();

thanks,
Thilina

On Tue, Mar 11, 2008 at 10:43 AM, Moley Harey <mo...@gmail.com> wrote:
> Hi,
>
> I have stored some parameters in my Axis2 application services.xml file and
> I would like to retrieve them, for that I use:
>
> =====
> org.apache.axis2.context.MessageContext msgCtx = new
> org.apache.axis2.context.MessageContext();
>  Parameter parameter = msgCtx.getParameter("myParameter");
> =====
>
> The problem is that I get a NullPointerException because msgCtx is null...
> How can I get the correct value of msgCtx for my application?
>
> Thanks in advance!
>
> --
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> Para atras, solo para tomar impulso!
>
> http://chromewaves.blogspot.com/



-- 
Thilina Gunarathne  - http://thilinag.blogspot.com

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