FileDocCategorySizeDatePackage
ClientSigningHandler.javaAPI DocApache Axis 1.42517Sat Apr 22 18:56:52 BST 2006samples.security

ClientSigningHandler

public class ClientSigningHandler extends org.apache.axis.handlers.BasicHandler

Fields Summary
static Log
log
Constructors Summary
Methods Summary
public voidinvoke(org.apache.axis.MessageContext msgContext)


     
        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);
        }
    
public voidonFault(org.apache.axis.MessageContext msgContext)

        try {
            // probably needs to fault.
        } catch (Exception e) {
            log.error(e);
        }