On Thursday 26 August 2010 5:40:44 pm kettch wrote:
> Daniel  Kulp wrote:
> > MessageContext mc = context.getMessageContext();
> > 
> > Then one of:
> >  AuthorizationPolicy policy =
> > 
> > (AuthorizationPolicy)mc.get(AuthorizationPolicy.class.getName());
> > 
> > or if you want to use JAX-WS standard calls:
> > 
> > mc.getPrincipal()
> > 
> > to get the User principal from the HTTP stack and pull the username and
> > password from there.
> > 
> > Dan
> 
> Hmm, this:
> 
> AuthorizationPolicy policy =
> (AuthorizationPolicy)mc.get(AuthorizationPolicy.class.getName());
> 
> still returns policy as a null object for me (although the earlier
> exception is now gone so that's good).
> 
> Also, this:
> 
> mc.getPrincipal()
> 
> doesn't seem to exist. MessageContext and WrappedMessageContext don't
> appear to have a getPrincipal method, am I missing something again?

Actually, it's on the WebServiceContext.

context.getUserPrincipal()

Dan


> 
> Ryan

-- 
Daniel Kulp
[email protected]
http://dankulp.com/blog

Reply via email to