aspose file tools
The moose likes Web Services and the fly likes Accessing http request headers from a service Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Web Services
Reply Bookmark "Accessing http request headers from a service" Watch "Accessing http request headers from a service" New topic
Author

Accessing http request headers from a service

Vilmantas Baranauskas
Ranch Hand

Joined: Dec 20, 2006
Posts: 89
Hi,

I'am using Axis (not Axis2) v1.4. Is there a way to read http request headers from implementation of my service. If yes, how?

Thank you,
Vilmantas


Author of <a href="http://www.newsinjector.com" target="_blank" rel="nofollow">NewsInjector</a>
NarendraBabu Bandaru
Greenhorn

Joined: May 17, 2008
Posts: 20
You can use the below mentioned sample code to access the http header data.

import org.apache.axis.MessageContext;
import org.apache.axis.transport.http.HTTPConstants;

MessageContext context = MessageContext.getCurrentContext();
HttpServletRequest req = (HttpServletRequest) context.getProperty(HTTPConstants.MC_HTTP_SERVLETREQUEST);

Thanks,
narendra
Vilmantas Baranauskas
Ranch Hand

Joined: Dec 20, 2006
Posts: 89
Thanks a lot!
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Accessing http request headers from a service
 
Similar Threads
SOAP Transfer and HTTP Transfer
use get method without displaying on url
doHead method
getting the timezone from the request
header names are case sensitive or not