You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fx-dev@ws.apache.org by Torgeir Veimo <to...@pobox.com> on 2005/05/24 15:33:31 UTC

setting password handler callback doesnt work..

I've tried dynamically setting a password callback for simple plain text
authentication, as per example in the documentation here;
http://ws.apache.org/ws-fx/wss4j/package.html

But it just doesn't work, there's no header added to the soap message.
I've seen that others have had problems, as described here;
http://www.mail-archive.com/fx-dev@ws.apache.org/msg00092.html

I've tried basically three ways of setting it up, here's one of them;

Service  service = new Service();
Call call = (Call) service.createCall();
call.setTargetEndpointAddress(new java.net.URL("http://localhost:8000/Serve"));
call.setOperationName(new QName("https://localhost:8000/Serve", "method0"));
call.setProperty(WSHandlerConstants.ACTION, WSHandlerConstants.USERNAME_TOKEN);                
call.setProperty(WSConstants.PASSWORD_TYPE_ATTR, WSConstants.PASSWORD_TEXT);
call.setProperty(WSHandlerConstants.PW_CALLBACK_CLASS, this.getClass().getName());
call.addParameter("param0", org.apache.axis.encoding.XMLType.XSD_STRING, javax.xml.rpc.ParameterMode.IN); 
call.setReturnType(org.apache.axis.encoding.XMLType.XSD_STRING);
String result = (String) call.invoke(new String[] {param});

Is this supposed to work? What is the best way to debug this? I am using
axis v1.2 and wss4j form CVS yesterday. wss4j was compiled with axis
v1.2rc3 as it comes with wss4jj CVS, but I assume it's not important.

-- 
Torgeir Veimo <to...@pobox.com>


Re: setting password handler callback doesnt work..

Posted by Torgeir Veimo <to...@pobox.com>.
On Tue, 2005-05-24 at 08:28 -0700, Ashok Shah wrote:
> > call.setProperty(WSConstants.PASSWORD_TYPE_ATTR,  
> > WSConstants.PASSWORD_TEXT);
> 
> Should be ..
> 
> call.setProperty(WSHandlerConstants.PASSWORD_TYPE,  
> WSContants.PASSWORD_DIGEST);

Slightly unrelated, I get a Type="" attribute on the <wxxe:Password ..>
like

<wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">

Is it possible to suppress the Type="" attribute in some way?

-- 
Torgeir Veimo <to...@pobox.com>


Re: Unsupported major.minor version?

Posted by csj <jo...@clarkson.edu>.
It was because I was using java 1.4, works fine with 1.5

On Thu, 26 May 2005, csj wrote:

> Could someone explain what version conflicts I am having here... I am
> using the same jars on both the client and the server.
>
> Exception in thread "main" java.lang.UnsupportedClassVersionError:
> org/apache/ws/axis/security/WSDoAllSender (Unsupported major.minor version
> 49.0)
>
> Thanks
> Chris
>

Unsupported major.minor version?

Posted by csj <jo...@clarkson.edu>.
Could someone explain what version conflicts I am having here... I am
using the same jars on both the client and the server.

Exception in thread "main" java.lang.UnsupportedClassVersionError:
org/apache/ws/axis/security/WSDoAllSender (Unsupported major.minor version
49.0)

Thanks
Chris

Re: setting password handler callback doesnt work..

Posted by Torgeir Veimo <to...@pobox.com>.
On Tue, 2005-05-24 at 08:28 -0700, Ashok Shah wrote:
> > call.setProperty(WSConstants.PASSWORD_TYPE_ATTR,  
> > WSConstants.PASSWORD_TEXT);
> 
> Should be ..
> 
> call.setProperty(WSHandlerConstants.PASSWORD_TYPE,  
> WSContants.PASSWORD_DIGEST);
> 
> 
> > - I get a digested password.. How can I specify a clear text password (I
> > didn't set up the server side service..)?

Actually, I fixed it using 

call.setProperty(UsernameToken.PASSWORD_TYPE, WSConstants.PW_TEXT);

A slightly different issue, if I use java stubs created using WSDL2Java,
I can set properties by casting, eg.

HmmPortType servePort = locator.getHmm();
((org.apache.axis.client.Stub)servePort)._setProperty(WSHandlerConstants.ACTION, WSHandlerConstants.USERNAME_TOKEN);

But there is no corresponding way of setting  client handlers?

((org.apache.axis.client.Stub)servePort)._setClientHandlers(new WSDoAllSender(), new WSDoAllReceiver());

-- 
Torgeir Veimo <to...@pobox.com>


Re: setting password handler callback doesnt work..

Posted by Ashok Shah <as...@sfu.ca>.
> call.setProperty(WSConstants.PASSWORD_TYPE_ATTR,  
> WSConstants.PASSWORD_TEXT);

Should be ..

call.setProperty(WSHandlerConstants.PASSWORD_TYPE,  
WSContants.PASSWORD_DIGEST);


> - I get a digested password.. How can I specify a clear text password (I
> didn't set up the server side service..)?
>



-- 
Ashok Shah

Re: setting password handler callback doesnt work..

Posted by Ashok Shah <as...@sfu.ca>.
On Tue, 24 May 2005 14:58:51 +0100, Torgeir Veimo <to...@pobox.com>  
wrote:

> On Tue, 2005-05-24 at 14:33 +0100, Torgeir Veimo wrote:
>> I've tried dynamically setting a password callback for simple plain text
>> authentication, as per example in the documentation here;
>> http://ws.apache.org/ws-fx/wss4j/package.html
>
>> Is this supposed to work?
>
> Additionally, it should be possible to use axis and wss4j together
> without using any client config file? Am trying to avoid calling eg.
> System.setProperty("axis.ClientConfigFile", "client_deploy.wsdd");
>


Try call.setClientHandlers(new WSDoAllSender(), new WSDoAllReciever());

Cheers,

--as

Re: setting password handler callback doesnt work..

Posted by Torgeir Veimo <to...@pobox.com>.
On Tue, 2005-05-24 at 14:33 +0100, Torgeir Veimo wrote:
> I've tried dynamically setting a password callback for simple plain text
> authentication, as per example in the documentation here;
> http://ws.apache.org/ws-fx/wss4j/package.html

> Is this supposed to work?

Additionally, it should be possible to use axis and wss4j together
without using any client config file? Am trying to avoid calling eg.
System.setProperty("axis.ClientConfigFile", "client_deploy.wsdd");

-- 
Torgeir Veimo <to...@pobox.com>