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 "Jose M. Selman" <js...@bee.cl> on 2004/06/05 23:47:26 UTC

Passing Objects Through Handlers Axis 1.1

Hi:
    I need to pass objects between a Client and a handler that does request
message signing. I just need to pass the private key and certificate to the
handler to sign every outgoing requests. This is needed because this will be
a generic client that will be called using different digital ids. I'm doing:

MessageContext context = call.getMessageContext();
context.setProperty("privatekey", privateKey);
context.setProperty("x509certificate", cert);
String result = (String) call.invoke(new Object[] { inputXML });

In the handler I have:

PrivateKey privateKey = (PrivateKey) msgContext.getProperty("privatekey");
X509Certificate cert = (X509Certificate)
msgContext.getProperty("x509certificate");
if ( privateKey == null ) {
    log("privateKey is null");
}
if ( cert == null ) {
    log("cert is null");
}

Both logging statements are printed.... Any ideas on what can be wrong or
missing?

Cheers

Jose M. Selman


Re: Passing Objects Through Handlers Axis 1.1

Posted by "Jose M. Selman" <js...@bee.cl>.
That worked! :-)

Thanks,

Jose M. Selman

----- Original Message ----- 
From: "Davanum Srinivas" <da...@gmail.com>
To: <ax...@ws.apache.org>
Sent: Saturday, June 05, 2004 5:56 PM
Subject: Re: Passing Objects Through Handlers Axis 1.1


> try using call's setProperty/
>
> -- dims
>
> On Sat, 5 Jun 2004 17:47:26 -0400, Jose M. Selman <js...@bee.cl> wrote:
> >
> > Hi:
> >     I need to pass objects between a Client and a handler that does
request
> > message signing. I just need to pass the private key and certificate to
the
> > handler to sign every outgoing requests. This is needed because this
will be
> > a generic client that will be called using different digital ids. I'm
doing:
> >
> > MessageContext context = call.getMessageContext();
> > context.setProperty("privatekey", privateKey);
> > context.setProperty("x509certificate", cert);
> > String result = (String) call.invoke(new Object[] { inputXML });
> >
> > In the handler I have:
> >
> > PrivateKey privateKey = (PrivateKey)
msgContext.getProperty("privatekey");
> > X509Certificate cert = (X509Certificate)
> > msgContext.getProperty("x509certificate");
> > if ( privateKey == null ) {
> >     log("privateKey is null");
> > }
> > if ( cert == null ) {
> >     log("cert is null");
> > }
> >
> > Both logging statements are printed.... Any ideas on what can be wrong
or
> > missing?
> >
> > Cheers
> >
> > Jose M. Selman
> >
> >


Re: Passing Objects Through Handlers Axis 1.1

Posted by Davanum Srinivas <da...@gmail.com>.
try using call's setProperty/

-- dims

On Sat, 5 Jun 2004 17:47:26 -0400, Jose M. Selman <js...@bee.cl> wrote:
> 
> Hi:
>     I need to pass objects between a Client and a handler that does request
> message signing. I just need to pass the private key and certificate to the
> handler to sign every outgoing requests. This is needed because this will be
> a generic client that will be called using different digital ids. I'm doing:
> 
> MessageContext context = call.getMessageContext();
> context.setProperty("privatekey", privateKey);
> context.setProperty("x509certificate", cert);
> String result = (String) call.invoke(new Object[] { inputXML });
> 
> In the handler I have:
> 
> PrivateKey privateKey = (PrivateKey) msgContext.getProperty("privatekey");
> X509Certificate cert = (X509Certificate)
> msgContext.getProperty("x509certificate");
> if ( privateKey == null ) {
>     log("privateKey is null");
> }
> if ( cert == null ) {
>     log("cert is null");
> }
> 
> Both logging statements are printed.... Any ideas on what can be wrong or
> missing?
> 
> Cheers
> 
> Jose M. Selman
> 
>