views:

10

answers:

1

Hi all,

I currently have a JAX-WS Web Service that receives some credentials in the HTTP header. These are used for BASIC authentication.

There is a filter that performs authentication by reading the HTTP headers and checking against the database.

Still, I need the username from within the Web Service in order to perform other service logic related stuff. Is there a way of accessing the HTTP headers from within the Web Service?

Thanks.

A: 

The WebServiceContext object does the work for me. It ca be easily injected in my web services as a Resource:

@Resource private WebServiceContext context;

Anonimo