Re: [Axis2] MessageContext w/o any properties

2006-07-30 Thread Davanum Srinivas

ok deprecated Constants.HTTP_SERVLET_REQUEST and made sure that
HTTPConstants.MC_HTTP_SERVLETREQUEST works.

-- dims

On 7/30/06, Sanjiva Weerawarana <[EMAIL PROTECTED]> wrote:

On Mon, 2006-07-17 at 10:00 +0200, heikki wrote:
> Hi Deepal,
>
> yes it works now ! I'm using the nighlty build fom July 16th.
>
> To summarize -- the way that you indicated is the *only* way that
> works, that is to say :
>
> - you must use Constants.HTTP_SERVLET_REQUEST (and not
> HTTPConstants.MC_HTTP_SERVLETREQUEST) ;

Why do we have both these constants? It seems like a bug to me!

> - you must use msgCtx.getProperty() (and not
> msgCtx.getOperationContext().getProperty() )
>
> Otherwise the HttpServletRequest won't be found.

The transport details for a given message context are only available
from that message context. So if you're processing the incoming message
then you can look up the transport info from that message context. If
you're processing the outgoing message (of an IN-OUT MEP) and want the
servlet context associated with the incoming message, then you need to
get the incoming MC from the operation context and then ask it for the
transport info.

Sanjiva.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





--
Davanum Srinivas : http://www.wso2.net (Oxygen for Web Service Developers)

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [Axis2] MessageContext w/o any properties

2006-07-29 Thread Sanjiva Weerawarana
On Mon, 2006-07-17 at 10:00 +0200, heikki wrote:
> Hi Deepal,
> 
> yes it works now ! I'm using the nighlty build fom July 16th. 
> 
> To summarize -- the way that you indicated is the *only* way that
> works, that is to say :
> 
> - you must use Constants.HTTP_SERVLET_REQUEST (and not
> HTTPConstants.MC_HTTP_SERVLETREQUEST) ;

Why do we have both these constants? It seems like a bug to me!

> - you must use msgCtx.getProperty() (and not
> msgCtx.getOperationContext().getProperty() )
> 
> Otherwise the HttpServletRequest won't be found.

The transport details for a given message context are only available
from that message context. So if you're processing the incoming message
then you can look up the transport info from that message context. If
you're processing the outgoing message (of an IN-OUT MEP) and want the
servlet context associated with the incoming message, then you need to
get the incoming MC from the operation context and then ask it for the
transport info.

Sanjiva.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [Axis2] MessageContext w/o any properties

2006-07-17 Thread Deepal Jayasinghe
heikki wrote:

> Hi Deepal,
>
> yes it works now ! I'm using the nighlty build fom July 16th.
>
> To summarize -- the way that you indicated is the *only* way that
> works, that is to say :
>
> - you must use Constants.HTTP_SERVLET_REQUEST (and not
> HTTPConstants.MC_HTTP_SERVLETREQUEST) ;
> - you must use msgCtx.getProperty() (and not
> msgCtx.getOperationContext().getProperty() )

Yes that is the correct behavior.

>
> Otherwise the HttpServletRequest won't be found.
>
> Thank you very much !
> Heikki Doeleman
>
>
> On 7/13/06, *Deepal Jayasinghe* <[EMAIL PROTECTED]
> > wrote:
>
> Hi Heikki;
>
> I am sorry for my mistake , I thought that you are invoking service
> using http post ,
> there was a problem in http get and I fixed that in current code
> base ,
> so you will be able to get the HttpServlet Request  using
>
> httpServletRequest = (HttpServletRequest)
> msgContext.getProperty(Constants.HTTP_SERVLET_REQUEST );
>
> if you use either nightly builds or current svn code .
>
> heikki wrote:
>
> > thanks for the tips, alas I'm still not getting the HttpServlet
> Request ..
> >
> > I tried, in the handler :
> >
> > 1. Deepal's tip :
> >
> > httpServletRequest = (HttpServletRequest)
> > msgContext.getProperty(Constants.HTTP_SERVLET_REQUEST );
> >
> > 2. Robert's tip :
> >
> > httpServletRequest = (HttpServletRequest)
> >
> 
> msgContext.getOperationContext().getProperty(HTTPConstants.MC_HTTP_SERVLETREQUEST);
> >
> > 3. those two combined :
> >
> > httpServletRequest = (HttpServletRequest)
> >
> 
> msgContext.getOperationContext().getProperty(Constants.HTTP_SERVLET_REQUEST);
> >
> > In each case, I don't find the HttpServletContext, instead ending up
> > with null.
> >
> > This being so, I do not fully understand this remark from
> Robert's post :
> >
> >
> > "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. "
> >
> > My handler is used to process incoming messages; how could I get
> > things from outgoing MC at this stage ? Could you explain what is
> > meant here?
> >
> > Does anyone have more advice on how I could obtain the
> > HttpServletContext in a handler that operates on incoming messages?
> > Surely this should be a quite easy task ..
> >
> > thank you and regards,
> > Heikki Doeleman
> >
> >
> >
> >
> >
> >
> >
> > On 7/13/06, *Carsten Ziegeler* <[EMAIL PROTECTED]
> 
> > >> wrote:
> >
> > This is a bug in the MessageContext which has been discussed
> > recently on
> > the dev list. The getProperties() method of the
> MessageContext always
> > returns an empty map. So you can only get those properties you
> > know the
> > key of by calling getProperty(key).
> >
> > Carsten
> >
> > Deepal Jayasinghe wrote:
> > > You need to call
> > > msgCtx.getProperty(Constants.HTTP_SERVLET_REQUEST );
> > >
> > > heikki 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

Re: [Axis2] MessageContext w/o any properties

2006-07-17 Thread heikki
Hi Deepal,yes it works now ! I'm using the nighlty build fom July 16th. To summarize -- the way that you indicated is the *only* way that works, that is to say :- you must use Constants.HTTP_SERVLET_REQUEST
 (and not HTTPConstants.MC_HTTP_SERVLETREQUEST) ;- you must use msgCtx.getProperty() (and not msgCtx.getOperationContext().getProperty() )Otherwise the HttpServletRequest won't be found.Thank you very much !
Heikki DoelemanOn 7/13/06, Deepal Jayasinghe <[EMAIL PROTECTED]> wrote:
Hi Heikki;I am sorry for my mistake , I thought that you are invoking serviceusing http post ,there was a problem in http get and I fixed that in current code base ,so you will be able to get the HttpServlet Request  using
httpServletRequest = (HttpServletRequest)msgContext.getProperty(Constants.HTTP_SERVLET_REQUEST );if you use either nightly builds or current svn code .heikki wrote:> thanks for the tips, alas I'm still not getting the HttpServlet Request ..
>> I tried, in the handler :>> 1. Deepal's tip :>> httpServletRequest = (HttpServletRequest)> msgContext.getProperty(Constants.HTTP_SERVLET_REQUEST );>> 2. Robert's tip :
>> httpServletRequest = (HttpServletRequest)> msgContext.getOperationContext().getProperty(HTTPConstants.MC_HTTP_SERVLETREQUEST);>> 3. those two combined :>> httpServletRequest = (HttpServletRequest)
> msgContext.getOperationContext().getProperty(Constants.HTTP_SERVLET_REQUEST);>> In each case, I don't find the HttpServletContext, instead ending up> with null.>> This being so, I do not fully understand this remark from Robert's post :
>>> "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. "
>> My handler is used to process incoming messages; how could I get> things from outgoing MC at this stage ? Could you explain what is> meant here?>> Does anyone have more advice on how I could obtain the
> HttpServletContext in a handler that operates on incoming messages?> Surely this should be a quite easy task ..>> thank you and regards,> Heikki Doeleman
 On 7/13/06, *Carsten Ziegeler* <[EMAIL PROTECTED]> [EMAIL PROTECTED]>> wrote:
>> This is a bug in the MessageContext which has been discussed> recently on> the dev list. The getProperties() method of the MessageContext always> returns an empty map. So you can only get those properties you
> know the> key of by calling getProperty(key).>> Carsten>> Deepal Jayasinghe wrote:> > You need to call> > msgCtx.getProperty(Constants.HTTP_SERVLET_REQUEST
);> >> > heikki 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> >>  --> Carsten Ziegeler - Open Source Group, S&N AG
> http://www.s-und-n.de> http://www.osoco.org/weblogs/rael/>> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]> [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]> [EMAIL PROTECTED]
>>>--Thanks,Deepal~Future is Open~-
To unsubscribe, e-mail: [EMAIL PROTECTED]For additional commands, e-mail: [EMAIL PROTECTED]



RE: [Axis2] MessageContext w/o any properties

2006-07-14 Thread Rishikesh . Mallesh
Hi 

Could anybody tell me how do I get the HTTPServletRequest object in Axis
1.3?

Thanks!

-Original Message-
From: Deepal Jayasinghe [mailto:[EMAIL PROTECTED] 
Sent: 13 July 2006 17:25
To: axis-user@ws.apache.org
Subject: Re: [Axis2] MessageContext w/o any properties

Hi Heikki;

I am sorry for my mistake , I thought that you are invoking service
using http post ,
there was a problem in http get and I fixed that in current code base ,
so you will be able to get the HttpServlet Request  using

httpServletRequest = (HttpServletRequest)
msgContext.getProperty(Constants.HTTP_SERVLET_REQUEST );

if you use either nightly builds or current svn code .

heikki wrote:

> thanks for the tips, alas I'm still not getting the HttpServlet Request ..
>
> I tried, in the handler :
>
> 1. Deepal's tip :
>
> httpServletRequest = (HttpServletRequest)
> msgContext.getProperty(Constants.HTTP_SERVLET_REQUEST );
>
> 2. Robert's tip :
>
> httpServletRequest = (HttpServletRequest)
>
msgContext.getOperationContext().getProperty(HTTPConstants.MC_HTTP_SERVLETRE
QUEST);
>
> 3. those two combined :
>
> httpServletRequest = (HttpServletRequest)
>
msgContext.getOperationContext().getProperty(Constants.HTTP_SERVLET_REQUEST)
;
>
> In each case, I don't find the HttpServletContext, instead ending up
> with null.
>
> This being so, I do not fully understand this remark from Robert's post :
>
>
> "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. "
>
> My handler is used to process incoming messages; how could I get
> things from outgoing MC at this stage ? Could you explain what is
> meant here?
>
> Does anyone have more advice on how I could obtain the
> HttpServletContext in a handler that operates on incoming messages?
> Surely this should be a quite easy task ..
>
> thank you and regards,
> Heikki Doeleman
>
>
>
>
>
>
>
> On 7/13/06, *Carsten Ziegeler* <[EMAIL PROTECTED]
> <mailto:[EMAIL PROTECTED]>> wrote:
>
> This is a bug in the MessageContext which has been discussed
> recently on
> the dev list. The getProperties() method of the MessageContext always
> returns an empty map. So you can only get those properties you
> know the
> key of by calling getProperty(key).
>
> Carsten
>
> Deepal Jayasinghe wrote:
> > You need to call
> > msgCtx.getProperty(Constants.HTTP_SERVLET_REQUEST);
> >
> > heikki 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
> >
> >
>
>
> --
> Carsten Ziegeler - Open Source Group, S&N AG
> http://www.s-und-n.de
> http://www.osoco.org/weblogs/rael/
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> <mailto:[EMAIL PROTECTED]>
> For addition

Re: [Axis2] MessageContext w/o any properties

2006-07-13 Thread Deepal Jayasinghe
Hi Heikki;

I am sorry for my mistake , I thought that you are invoking service
using http post ,
there was a problem in http get and I fixed that in current code base ,
so you will be able to get the HttpServlet Request  using

httpServletRequest = (HttpServletRequest)
msgContext.getProperty(Constants.HTTP_SERVLET_REQUEST );

if you use either nightly builds or current svn code .

heikki wrote:

> thanks for the tips, alas I'm still not getting the HttpServlet Request ..
>
> I tried, in the handler :
>
> 1. Deepal's tip :
>
> httpServletRequest = (HttpServletRequest)
> msgContext.getProperty(Constants.HTTP_SERVLET_REQUEST );
>
> 2. Robert's tip :
>
> httpServletRequest = (HttpServletRequest)
> msgContext.getOperationContext().getProperty(HTTPConstants.MC_HTTP_SERVLETREQUEST);
>
> 3. those two combined :
>
> httpServletRequest = (HttpServletRequest)
> msgContext.getOperationContext().getProperty(Constants.HTTP_SERVLET_REQUEST);
>
> In each case, I don't find the HttpServletContext, instead ending up
> with null.
>
> This being so, I do not fully understand this remark from Robert's post :
>
>
> "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. "
>
> My handler is used to process incoming messages; how could I get
> things from outgoing MC at this stage ? Could you explain what is
> meant here?
>
> Does anyone have more advice on how I could obtain the
> HttpServletContext in a handler that operates on incoming messages?
> Surely this should be a quite easy task ..
>
> thank you and regards,
> Heikki Doeleman
>
>
>
>
>
>
>
> On 7/13/06, *Carsten Ziegeler* <[EMAIL PROTECTED]
> > wrote:
>
> This is a bug in the MessageContext which has been discussed
> recently on
> the dev list. The getProperties() method of the MessageContext always
> returns an empty map. So you can only get those properties you
> know the
> key of by calling getProperty(key).
>
> Carsten
>
> Deepal Jayasinghe wrote:
> > You need to call
> > msgCtx.getProperty(Constants.HTTP_SERVLET_REQUEST);
> >
> > heikki 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
> >
> >
>
>
> --
> Carsten Ziegeler - Open Source Group, S&N AG
> http://www.s-und-n.de
> http://www.osoco.org/weblogs/rael/
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> 
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
>
>

-- 
Thanks,
Deepal

~Future is Open~ 




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [Axis2] MessageContext w/o any properties

2006-07-13 Thread heikki
Yes, I'm sure.. it happens before invocation of the SEI. Just to verify I put in your code snippet, added printlns about the results :    if ( msgContext.getFLOW() == MessageContext.IN_FLOW ) {    // get servlet context, request object
    final ServletContext servletContext = (ServletContext) msgContext.getProperty(Constants.SERVLET_CONTEXT);    if(servletContext == null) {    System.out.println("servletcontext is null");
    }    final HttpServletRequest request = (HttpServletRequest) msgContext.getProperty(Constants.HTTP_SERVLET_REQUEST);    if(request == null) {    System.out.println("httpservletrequest is null");
    }        }  this puts out :servletcontext is nullhttpservletrequest is nullSince this code does do it for you, I'm really starting to wonder what might be wrong. Might it be due to my using WebLogic, incl. the  classloader setting ? Or might it have to do with the particular nightly build I'm using (from about 3 weeks ago) ?
As you can guess: any help, tips and advice is very welcome !Heikki DoelemanOn 7/13/06, Carsten Ziegeler <
[EMAIL PROTECTED]> wrote:Just to be sure, are you sure that your handler is only invoked for
incomming request? (I did this mistake and then run into an NPE as theservlet request object is only available in the incomming flow, and Itried to access it on the outgoing flow as well).So this is my code which actually works for me:
if ( messageContext.getFLOW() == MessageContext.IN_FLOW ) {// get servlet context, request objectfinal ServletContext servletContext = (ServletContext)messageContext.getProperty
(Constants.SERVLET_CONTEXT);final HttpServletRequest request = (HttpServletRequest)messageContext.getProperty(Constants.HTTP_SERVLET_REQUEST);}And they are both not null.HTH
Carstenheikki wrote:> thanks for the tips, alas I'm still not getting the HttpServlet Request ..>> I tried, in the handler :>> 1. Deepal's tip :>> httpServletRequest = (HttpServletRequest) 
msgContext.getProperty(> Constants.HTTP_SERVLET_REQUEST);>> 2. Robert's tip :>> httpServletRequest = (HttpServletRequest) msgContext.getOperationContext> ().getProperty(HTTPConstants.MC_HTTP_SERVLETREQUEST
);>> 3. those two combined :>> httpServletRequest = (HttpServletRequest) msgContext.getOperationContext> ().getProperty(Constants.HTTP_SERVLET_REQUEST);>> In each case, I don't find the HttpServletContext, instead ending up with
> null.>> This being so, I do not fully understand this remark from Robert's post :>>> "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. ">> My handler is used to process incoming messages; how could I get things from> outgoing MC at this stage ? Could you explain what is meant here?
>> Does anyone have more advice on how I could obtain the HttpServletContext in> a handler that operates on incoming messages? Surely this should be a quite> easy task ..>
--Carsten Ziegeler - Open Source Group, S&N AGhttp://www.s-und-n.dehttp://www.osoco.org/weblogs/rael/-
To unsubscribe, e-mail: [EMAIL PROTECTED]For additional commands, e-mail: [EMAIL PROTECTED]



Re: [Axis2] MessageContext w/o any properties

2006-07-13 Thread Carsten Ziegeler
Just to be sure, are you sure that your handler is only invoked for
incomming request? (I did this mistake and then run into an NPE as the
servlet request object is only available in the incomming flow, and I
tried to access it on the outgoing flow as well).
So this is my code which actually works for me:
if ( messageContext.getFLOW() == MessageContext.IN_FLOW ) {
// get servlet context, request object
final ServletContext servletContext = (ServletContext)
messageContext.getProperty(Constants.SERVLET_CONTEXT);
final HttpServletRequest request = (HttpServletRequest)
messageContext.getProperty(Constants.HTTP_SERVLET_REQUEST);
}
And they are both not null.

HTH
Carsten

heikki wrote:
> thanks for the tips, alas I'm still not getting the HttpServlet Request ..
> 
> I tried, in the handler :
> 
> 1. Deepal's tip :
> 
> httpServletRequest = (HttpServletRequest) msgContext.getProperty(
> Constants.HTTP_SERVLET_REQUEST);
> 
> 2. Robert's tip :
> 
> httpServletRequest = (HttpServletRequest) msgContext.getOperationContext
> ().getProperty(HTTPConstants.MC_HTTP_SERVLETREQUEST);
> 
> 3. those two combined :
> 
> httpServletRequest = (HttpServletRequest) msgContext.getOperationContext
> ().getProperty(Constants.HTTP_SERVLET_REQUEST);
> 
> In each case, I don't find the HttpServletContext, instead ending up with
> null.
> 
> This being so, I do not fully understand this remark from Robert's post :
> 
> 
> "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. "
> 
> My handler is used to process incoming messages; how could I get things from
> outgoing MC at this stage ? Could you explain what is meant here?
> 
> Does anyone have more advice on how I could obtain the HttpServletContext in
> a handler that operates on incoming messages? Surely this should be a quite
> easy task ..
> 



-- 
Carsten Ziegeler - Open Source Group, S&N AG
http://www.s-und-n.de
http://www.osoco.org/weblogs/rael/

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [Axis2] MessageContext w/o any properties

2006-07-13 Thread heikki
thanks for the tips, alas I'm still not getting the HttpServlet Request ..I tried, in the handler :1. Deepal's tip :httpServletRequest = (HttpServletRequest) msgContext.getProperty(Constants.HTTP_SERVLET_REQUEST
);2. Robert's tip :httpServletRequest = (HttpServletRequest) msgContext.getOperationContext().getProperty(HTTPConstants.MC_HTTP_SERVLETREQUEST);3. those two combined :httpServletRequest = (HttpServletRequest) 
msgContext.getOperationContext().getProperty(Constants.HTTP_SERVLET_REQUEST);In each case, I don't find the HttpServletContext, instead ending up with null.This being so, I do not fully understand this remark from Robert's post :
"Its by design- you have to get the operation context from the outgoingMC and then get the incoming MC from that and look there for the servletcontext and any other "incoming" info. "
My handler is used to process incoming messages; how could I get things from outgoing MC at this stage ? Could you explain what is meant here?Does anyone have more advice on how I could obtain the HttpServletContext in a handler that operates on incoming messages? Surely this should be a quite easy task .. 
thank you and regards,Heikki DoelemanOn 7/13/06, Carsten Ziegeler <[EMAIL PROTECTED]
> wrote:This is a bug in the MessageContext which has been discussed recently on
 the dev list. The getProperties() method of the MessageContext alwaysreturns an empty map. So you can only get those properties you know thekey of by calling getProperty(key).CarstenDeepal Jayasinghe wrote:
> You need to call> msgCtx.getProperty(Constants.HTTP_SERVLET_REQUEST);>> heikki 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>>--Carsten Ziegeler - Open Source Group, S&N AG
http://www.s-und-n.dehttp://www.osoco.org/weblogs/rael/-
To unsubscribe, e-mail: [EMAIL PROTECTED]For additional commands, e-mail: [EMAIL PROTECTED]



Re: [Axis2] MessageContext w/o any properties

2006-07-13 Thread Carsten Ziegeler
This is a bug in the MessageContext which has been discussed recently on
 the dev list. The getProperties() method of the MessageContext always
returns an empty map. So you can only get those properties you know the
key of by calling getProperty(key).

Carsten

Deepal Jayasinghe wrote:
> You need to call
> msgCtx.getProperty(Constants.HTTP_SERVLET_REQUEST);
> 
> heikki 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
> 
> 


-- 
Carsten Ziegeler - Open Source Group, S&N AG
http://www.s-und-n.de
http://www.osoco.org/weblogs/rael/

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [Axis2] MessageContext w/o any properties

2006-07-12 Thread Deepal Jayasinghe
You need to call
msgCtx.getProperty(Constants.HTTP_SERVLET_REQUEST);

heikki 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


-- 
Thanks,
Deepal

~Future is Open~ 



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [Axis2] MessageContext w/o any properties

2006-07-12 Thread robert lazarski

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 <[EMAIL PROTECTED]> 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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [Axis2] MessageContext w/o any properties

2006-07-12 Thread heikki
Hi,I do it inside a custom handler, the code of which ispackage com.xxx.handler;import java.util.Map;import java.util.Set;import javax.servlet.http.HttpServletRequest;import org.apache.axis2.AxisFault
;import org.apache.axis2.context.MessageContext;import org.apache.axis2.engine.Handler;import org.apache.axis2.handlers.AbstractHandler;import org.apache.axis2.transport.http.HTTPConstants;import org.apache.commons.logging.Log
;import org.apache.commons.logging.LogFactory;public class GetRequestHandler extends AbstractHandler implements Handler {    private Log log = LogFactory.getLog(GetRequestHandler.class);    public void invoke(MessageContext msgContext) throws AxisFault {
 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 !!!  "); }         HttpServletRequest httpServletRequest = (HttpServletRequest) 
msgContext.getProperty(HTTPConstants.MC_HTTP_SERVLETREQUEST); if(httpServletRequest == null) {
  System.out.println("httpServletRequest is null !!!  ");
 }    }}On 7/12/06, Bruno Negrao <[EMAIL PROTECTED]> wrote:
Hi,from where did you obtain the msgContext object?brunoOn 7/12/06, heikki <[EMAIL PROTECTED]> 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>


Re: [Axis2] MessageContext w/o any properties

2006-07-12 Thread Bruno Negrao

Hi,

from where did you obtain the msgContext object?

bruno
On 7/12/06, heikki <[EMAIL PROTECTED]> 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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]