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:[EMAIL PROTECTED] 
> Sent: Montag, 11. Oktober 2004 16:06
> To: [EMAIL PROTECTED]
> 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
> 
> }
> 


Reply via email to