Hi all.
I have a web service and I need to know what user name call each time to my
web service.
In my service implementation I have a declared:
................
@javax.annotation.Resource
private WebServiceContext context;
................
With this variable I can access to MessageContext and get the user:
.................
List recv = (List)context.getMessageContext().get("RECV_RESULTS");
WSHandlerResult wsResult = (WSHandlerResult)recv.get(0);
WSSecurityEngineResult wsseResult =
(WSSecurityEngineResult)wsResult.getResults().get(0);
user = wsseResult.getPrincipal().getName();
.................
The problem is that --> context.getMessageContext().get("RECV_RESULTS"); is
always returning null.
Because of that i added too my configuration file the SAAJ and WSS4J
injector and use "UsernameToken".
(The configuration is attached below)
I dont know if when a user call the web service the web service have to show
a dialog when the user have to write the login and password.
Could anyone help me about this. Thanks in advance.
.................
<jaxws:endpoint ...... >
<jaxws:inInterceptors>
<bean class="org.apache.cxf.binding.soap.saaj.SAAJInInterceptor"/>
<bean class="org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor">
<constructor-arg>
<map>
<entry key="action" value="UsernameToken"/>
<entry key="passwordType" value="PasswordDigest" />
<entry key="passwordCallbackClass"
value="com.demo.MyPasswordCallBack"
/>
</map>
</constructor-arg>
</bean>
</jaxws:inInterceptors>
</jaxws:endpoint>
.............................
--
View this message in context:
http://www.nabble.com/WSS4JInterceptor-Exception-tf4574493.html#a13057324
Sent from the cxf-user mailing list archive at Nabble.com.