ByteArrayOutputStream out = new ByteArrayOutputStream(); org.apache.xml.security.utils.XMLUtils.outputDOMc14nWithComments(signedDoc,out);    logger.debug(out.toString());  md.dispatchMessage(new ByteArrayInputStream(out.toByteArray()));
md.verifyAndDispatchMessage(signedDoc);
    public static void main(String args[])            throws Exception {        //FileInputStream in = new FileInputStream(args[0]);        SignatureManager sigManager = new SignatureManagerImpl(new FakeDataSource());        MessageDispatcher md = new MessageDispatcher(sigManager);        FindService findService = new FindService("*");        findService.setMaxRows(5);        FindQualifiers fqs = new FindQualifiers();        fqs.add(new FindQualifier("foobar"));        findService.setFindQualifiers(fqs);        Document document = md.documentBuilder.newDocument();        Element envelope = document.createElement("Envelope");        envelope.setAttribute("xmlns","http://schemas.xmlsoap.org/soap/envelope/");        Element body = document.createElement("Body");        envelope.appendChild(body);        document.appendChild(envelope);        findService.saveToXML(body);        Document signedDoc = sigManager.signDocument(document);        ByteArrayOutputStream out = new ByteArrayOutputStream();        org.apache.xml.security.utils.XMLUtils.outputDOMc14nWithComments(signedDoc,out);        //md.xmlSerializer.setOutputByteStream(out);        //md.xmlSerializer.serialize(signedDoc);        logger.debug(out.toString());        md.dispatchMessage(new ByteArrayInputStream(out.toByteArray()));   }