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,

 

------------------------------

 

Reply via email to