You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Michael Muller <mi...@s-h.ch> on 2004/06/28 20:14:33 UTC

WS that retrieve username and passwords

Hi all,

I have a Java Client that make this request :
       Service  service = new Service();
       Call     call    = (Call) service.createCall();
       call.setTargetEndpointAddress( new java.net.URL(endpoint) );
       call.setOperationName( new QName("urn:bc", "execute"));
       call.setUsername( username );
       call.setPassword( password );
       xmlResponse = (String) call.invoke( new Object[] {"Default", xmlRequest } );

I need to create a service that respond this client.

So I've created a server class:
public class Urnbc {
	public String execute(Object param1, Object param2){
//
	}
}

My question is:
How to retrieve the password and username from this class?


Thanks in advance,


Michael

Re: WS that retrieve username and passwords

Posted by Makesh Rao <ma...@yahoo.com>.
Hi Michael

This works for me:

MessageContext mc =
MessageContext.getCurrentContext();
String userid = mc.getUsername();
String passwd = mc.getPassword();

~Makesh

--- Michael Muller <mi...@s-h.ch> wrote:
> Hi all,
> 
> I have a Java Client that make this request�:
>        Service  service = new Service();
>        Call     call    = (Call)
> service.createCall();
>        call.setTargetEndpointAddress( new
> java.net.URL(endpoint) );
>        call.setOperationName( new QName("urn:bc",
> "execute"));
>        call.setUsername( username );
>        call.setPassword( password );
>        xmlResponse = (String) call.invoke( new
> Object[] {"Default", xmlRequest } );
> 
> I need to create a service that respond this client.
> 
> So I've created a server class:
> public class Urnbc {
> 	public String execute(Object param1, Object
> param2){
> //
> 	}
> }
> 
> My question is:
> How to retrieve the password and username from this
> class?
> 
> 
> Thanks in advance,
> 
> 
> Michael
> 


=====
N 37� 23' 41.8"
W 121� 56' 31.4"


		
__________________________________
Do you Yahoo!?
Yahoo! Mail Address AutoComplete - You start. We finish.
http://promotions.yahoo.com/new_mail