org.apache.xml.security.Init.init();
/** Sign the SOAPEnvelope
*/
try {
Handler serviceHandler = msgContext.getService();
String filename = (String) getOption("keystore");
if ((filename == null) || (filename.equals("")))
throw new AxisFault("Server.NoKeyStoreFile",
"No KeyStore file configured for the ClientSigningHandler!",
null, null);
Message requestMessage = msgContext.getRequestMessage();
SOAPEnvelope unsignedEnvelope = requestMessage.getSOAPEnvelope();
// need to correctly compute baseuri
SignedSOAPEnvelope signedEnvelope = new SignedSOAPEnvelope(msgContext, unsignedEnvelope, "http://xml-security", filename);
requestMessage = new Message(signedEnvelope);
msgContext.setCurrentMessage(requestMessage);
// and then pass on to next handler
//requestMessage.getSOAPPart().writeTo(System.out);
} catch (Exception e) {
throw AxisFault.makeFault(e);
}