axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Richardson" <james.richard...@db.com>
Subject RE: How to access HTTP headers from provider
Date Tue, 12 Oct 2004 10:05:14 GMT

Thank you! - Worked perfectly!

James


> -----Original Message-----
> From: Patrick Herber [mailto:patrick@arpage.ch]
> Sent: 12 October 2004 08:08
> To: axis-user@ws.apache.org
> Subject: RE: How to access HTTP headers from provider
> 
> Hi,
> 
> I made so:
> 
> MessageContext context = MessageContext.getCurrentContext();
> HttpServletRequest request = (HttpServletRequest)
> context.getProperty(HTTPConstants.MC_HTTP_SERVLETREQUEST);
> String myValue = req.getHeader("myHeader");
> 
> Regards,
> Patrick
> 
> 
> > -----Original Message-----
> > From: James Richardson [mailto:james.richardson@db.com]
> > Sent: Montag, 11. Oktober 2004 16:06
> > To: axis-user@ws.apache.org
> > Subject: RE: How to access HTTP headers from provider
> >
> >
> > If anybody could help me out with this question as posted a
> > few days ago, would very much appreciate it.
> >
> > I'm trying to get access to the original HTTP headers of the
> > SOAP request.
> > I have loked around in the docs, and it appears that one
> > should do as shown below, but the code, while compiling ok,
> > does not show anything.
> >
> > Using snoop I can see that of course some headers are being
> > sent, but the code will not print them out (or any header for
> > that matter).
> >
> > Any ideas?
> >
> > Thanks!
> >
> > James
> >
> > ----------
> >
> > Relevant bit of original post follows:
> >
> > I am trying to get access to some of the original HTTP
> > headers in order to record some information about the client,
> > who will be placing some headers in the request for me to read.
> >
> > I'm trying to get access to these HTTP headers, but can see
> > nothing....
> >
> > Heres a relevant bit of code:
> >
> >   protected Object invokeMethod( MessageContext msgContext,
> > Method method, Object obj, Object[] argValues ) throws Exception {
> >
> >     // FIXME - Remove test
> >
> >     MimeHeaders headers =
> > msgContext.getRequestMessage().getMimeHeaders();
> >
> >     Log.info ( this, msgContext.getUsername(),
> > "invokeMethod()", headers.getHeader( "SOAPAction" ) );
> >
> >     MimeHeader mimeheader = null;
> >
> >     for (Iterator iter = headers.getAllHeaders(); iter.hasNext();) {
> >       mimeheader = (MimeHeader) iter.next();
> >
> >       Log.info ( this, msgContext.getUsername(),
> > "invokeMethod()", "name="
> > + mimeheader.getName() + ", value=" + mimeheader.getValue());
> >     }
> >
> >
> >    // now invoke the method
> >
> > }
> >
> 


Mime
View raw message