Hi all,
I notice that wss4j has this class WSSecSignatureConfirmation defined
that can be used to send a signature confirmation. As described below, I
am having a custom client that talks to Sample Service 04. But this
gives an error about Signature Confirmation. I tried using this class,
but it still does not work. If I turn off the Signature Confirmation for
Sample Service 04 then it works fine.
Here is my sample code. I am adding the SignatureConfirmation but i
still get the error specified below. I was assuming that the Signature
is saved in the msgContext so that when the reply is received, it will
check against it. But it does not seem to work. Any help is appreciated.
Document doc = unsignedEnvelope.getAsDocument();
WSSecHeader secHeader = new WSSecHeader();
secHeader.insertSecurityHeader(doc);
WSSecTimestamp secTimestamp = new WSSecTimestamp();
secTimestamp.build(doc, secHeader);
WSSecSignatureConfirmation secSignConf = new
WSSecSignatureConfirmation();
Document signedDoc = signer.build(doc, crypto, secHeader);
byte[] ba = signer.getSignatureValue();
signedDoc = secSignConf.build(signedDoc, ba, secHeader);
// Convert the signed document into a SOAP message.
Message signedMsg =
SOAPUtil.toAxisMessage(signedDoc);
signedDoc = signedMsg.getSOAPEnvelope().getAsDocument();
SOAPEnvelope env = signedMsg.getSOAPEnvelope();
Same code as below.
Thanks,
--kumar
________________________________
From: Iyengar, Kumar [mailto:[email protected]]
Sent: Sunday, March 01, 2009 3:46 PM
To: [email protected]
Subject: Axis 1.4 and Rampart 1.4 - Signature Confirmation - got a SC
element, but no stored SV
Hi all,
I tried writing my own custom client that talks to the Sample Service (
sample 04) that comes with Rampart. I see in TCPMON that the request and
reply are being sent correctly, but I keep getting the error :
fault WSHandler: Check Signature confirmation: got a SC element, but no
stored SV; nested exception is:
org.apache.ws.security.WSSecurityException: WSHandler: Check
Signature confirmation: got a SC element, but no stored SV
Any help is appreciated. How do I indicate the Stored value that it is
trying to look up? I tried disabling signature confirmation, but then I
get an Action mismatch error.
Here is the client that I wrote:
WSDoAllReceiver respHandler2 = new WSDoAllReceiver();
Service service = new Service();
Call call = (Call) service.createCall();
call.setTargetEndpointAddress(new
java.net.URL("http://localhost:8888/axis2/services/sample04"));
call.setOperationName("echo");
call.setTimeout(new Integer(40 * 1000));
respHandler2.setOption(WSHandlerConstants.ACTION,
WSHandlerConstants.SIGNATURE);
respHandler2.setOption(WSHandlerConstants.ACTOR, "");
respHandler2.setOption(WSHandlerConstants.SIG_PROP_FILE ,
"client.properties");
call.setClientHandlers(null, respHandler2);
SOAPEnvelope outEnv = null;
try
{
outEnv = call.invoke(env);
}
Thanks,
--kumar