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 additional commands, e-mail: [EMAIL PROTECTED] > <mailto:[EMAIL PROTECTED]> > > -- Thanks, Deepal ................................................................ ~Future is Open~ --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] ------------------------------------------------------------------------------------------------------------ This message is intended for the addressee or its representative only. Any form of unauthorized use, publication, reproduction, copying or disclosure of the content of this e-mail is not permitted. If you are not the intended recipient of this e-mail message and its contents, please notify the sender immediately and delete this message and all its attachments subsequently. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]