Hello,

We used the code from the FAQ and it seems to work for
us:

http://wiki.apache.org/ws/FrontPage/WsFx/wss4jFAQ#usernme

Hope this helps...

Best,

Hernan

--- Ritwik Dey <[EMAIL PROTECTED]> wrote:

> Hi,
> 
>  
> 
> I'm using WSS4J for signing an XML message with the
> following wsdd(at client
> side) file & its working file.
> 
>  
> 
> <deployment xmlns="http://xml.apache.org/axis/wsdd/";
>
xmlns:java="http://xml.apache.org/axis/wsdd/providers/java";>
> 
>       <transport name="http"
>
pivot="java:org.apache.axis.transport.http.HTTPSender"/>
> 
>       <globalConfiguration>
> 
>             <requestFlow>
> 
>                   <handler
>
type="java:org.apache.ws.axis.security.WSDoAllSender">
> 
>                         <parameter name="user"
> value="wsrit"/>
> 
>                         <parameter
> name="passwordCallbackClass"
> value="clientE.PWCallback"/> 
> 
>                         <parameter name="action"
> value="Signature"/>
> 
>                         <parameter
> name="signaturePropFile"
> value="crypto.properties"/>
> 
>                   </handler>
> 
>             </requestFlow>
> 
>       </globalConfiguration>
> 
> </deployment>
> 
>  
> 
> Now I want to access the username (which is set in
> the client deployment
> file), at the receiver for some processing.
> 
> I've seen that at the client side, the username is
> set in the RequestData
> object by WSDoAllSender.
> 
> But when I'm trying to access the username at the
> server side (in
> WSDoAllReceiver) by following code it returns null.
> 
>  
> 
> RequestData reqData = new RequestData();
> 
> reqData.setMsgContext(messageContext);
> 
> String userName = reqData.getUsername(); // userName
> is showing null here.
> 
> if (reqData.getUsername() == null ||
> reqData.getUsername().equals("")) {
> 
>                 userName =
>
(String)messageContext.getProperty(WSHandlerConstants.USER);
> 
>            }
> 
> System.out.println("Username:"+userName); //
> userName is showing null here.
> 
>  
> 
> I've also tried messageContext.getUsername() and
> messageContext.getCurrentContext().getUsername(),
> but both of them returned
> null.
> 
> Can anyone help me out in this matter..
> 
>  
> 
>  
> 
> Thanks & Regards,
> 
> ------------------------------------
> 
> Ritwik Dey
> 
> Associate, 
> 
>  
> 
> ------------------------------
> 
>  
> 
> 



__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to