Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Accessing http request headers from a service  RSS feed

 
Vilmantas Baranauskas
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
NarendraBabu Bandaru
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 89
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot!
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!