axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "robert lazarski" <robertlazar...@gmail.com>
Subject Re: [Axis2] MessageContext w/o any properties
Date Wed, 12 Jul 2006 19:18:21 GMT
When using properties in a handler, try this:

messageContext.getOperationContext().getProperty(
            HTTPConstants.MC_HTTP_SERVLETREQUEST);

The way this works is explained here:

http://marc.theaimsgroup.com/?l=axis-dev&m=115255047000592&w=2

> In addition it seems that the outgoing MessageContext objects do not
> contain the servlet context. Is this by mistake or by design? If it's
> the latter, how can I access the servlet context?

Its by design- you have to get the operation context from the outgoing
MC and then get the incoming MC from that and look there for the servlet
context and any other "incoming" info.

and here to discuss a problem on its way of being resolved:

http://marc.theaimsgroup.com/?l=axis-dev&m=115260394402411&w=2

I personally use
messageContext.getFLOW() == MessageContext.OUT_FLOW  and
messageContext.getFLOW() == MessageContext.IN_FLOW to determine which
one I'm in, but you can uses LABEL as well.

HTH,
Robert
http://www.braziloutsource.com/



On 7/12/06, heikki <tropicano@gmail.com> wrote:
> Hi there,
>
> I'm trying to retrieve the HttpServletRequest in a handler, through its
> MessageContext, like so
>
> HttpServletRequest httpServletRequest = (HttpServletRequest)
> msgContext.getProperty(HTTPConstants.MC_HTTP_SERVLETREQUEST
> );
>
> However, running this,  httpServletRequest was null. On further examination
> I looked at all the properties I could get from MessageContext, using this
> code
>
>         Map propsMap = msgContext.getProperties();
>         if(propsMap.size() == 0) {
>             System.out.println("msgContext props map is empty !!!  ");
>         }
>         Set propsSet = props.entrySet();
>         if(propsSet.size() == 0) {
>              System.out.println("msgContext props set is empty !!!  ");
>         }
>
> which put out this
>
> msgContext props map is empty !!!
> msgContext props set is empty !!!
>
> Apparently, I don't have any property in the MessageContext in the handler.
> Is this usual? Should I take some extra step somewhere along the line?
>
> My purpose of getting HttpServletRequest is to retrieve URL params from the
> HTTP GET request. Is there another way to do achieve this?
>
>
> thanks and regards,
> Heikki Doeleman
>

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


Mime
View raw message